Subject: [xsl] returning to initial document after changing context via document() From: tom.kirkpatrick@xxxxxxxxxxxx Date: Tue, 22 Feb 2005 12:14:22 +0000 |
After having used the document function to get some node details from a config document, i need to return to the base document to continue processing. However, even though I have given an absolute path reference in the for-each statement, it seems to still be looking in the config document. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:vbtn="http://www.virusbtn.com/namespaces/documents/issue/1.0/" xmlns:prism="http://prismstandard.org/namespaces/1.2/basic/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:html="http://www.w3.org/1999/xhtml"> <xsl:output method="xml" indent="yes"/> <xsl:variable name="autodate" select="document('/global/autodate.xml')/date"/> <xsl:variable name="month" select="$autodate/month[@position = /vbtn:article/vbtn:metadata/prism:number ]/@name"/> <xsl:variable name="index" select="document('/articles/virusbulletin/index.xml')/articles"/> <xsl:key name="articles" match="@filename" use="."/> <xsl:template match="/"> <!-- article heading --> <h1> <xsl:value-of select="/vbtn:issue/vbtn:metadata/prism:publication"/>: <xsl:value-of select="/vbtn:issue/vbtn:metadata/prism:volume"/> </h1> <xsl:for-each select="$index/category"> <section name="{@name}"> <xsl:for-each select="/vbtn:issue/vbtn:content/vbtn:article"> <xsl:value-of select="@id"/> <br/> </xsl:for-each> </section> </xsl:for-each> </xsl:template> </xsl:stylesheet> so <xsl:for-each select="/vbtn:issue/vbtn:content/vbtn:article"> should be referencing the original document rather than the config document. Is there a special function to return the context to the base document? -- Tom David Kirkpatrick Virus Bulletin Web Developer, Virus Bulletin Tel: +44 1235 555139 Web: www.virusbtn.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] unique attribute values i, Michael Kay | Thread | Re: [xsl] returning to initial docu, David Carlisle |
Re: [xsl] xslt and the filesystem, David Carlisle | Date | Re: [xsl] returning to initial docu, tom . kirkpatrick |
Month |