[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

returning to initial document after changing context v

Subject: returning to initial document after changing context via document()
From: tom.kirkpatrick@xxxxxxxxxxxx
Date: Tue, 22 Feb 2005 12:14:22 +0000
xsl changing context
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.