[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XSL doubts
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Monday 22 April 2002 23:04, saravanababuraman@xxxxxxxxxxx wrote: > Hai Friend > > well i have a doubt about the document open ,if i open the document as loop > i could not able to acess the root variable from the XML inside the > docuemnt loop do you find any solution for these please explain me the > solution for these in the respected mail id saravanababuraman@xxxxxxxxxxx In the future you might consider posting to the XSL mailing list; most people do not appreciate being contacted directly. About your question, yes, this is a frequent problem. The solution is to store a reference to the root of the first document in a variable before the for-each, and then access the first document through that variable: <xsl:variable name="root" select="/"/> <xsl:for-each select="document('foo.xml')/bar"> ... <!-- access the /baz/zoit elements in the original document --> <xsl:value-of select="$root/bar/zoit"/> ... </xsl:for-each> Let me know if this helps. Also, if you use the key() function, there are other things you have to do. - -- Peter Davis -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE8xQAsNSZCJx7tYycRAgFKAJ9xHofbwao7JXqynLR1Hofme5lypQCfVxYl iSy08Gmwrq9CTC1tB5V5tX4= =gwst -----END PGP SIGNATURE----- XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|