[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] document() and attribute
hello, do any one help me to solve the following problem in a.xml contain b.xml file's element fellow's id, i got the fellow id from the a.xml file and put it into a variable $fellowID, and then i want to achieve the fellow details through b.xml file using element fellow's url <!-- a.xml ---> ... <!-- owner related to fellow element in b.xml --> <owner id="a" /> <owner id="b" /> <!-- b.xml --> <fellowlist> <fellows> <fellow id="a" url="atext.xml" /> <fellow id="b" url="btext.xml" /> </fellows> <fellowlist> <!-- a.xsl --> ... <xsl:variable name="ownerID"> <xsl:apply-templates select="./owner" /> </xsl:variable> <xsl:variable name="href"> <xsl:apply-templates select="document(b.xml')/fellow[@id=$ownerID]" /> </xsl:variable> <!-- do something like sort and outputting --> <xsl:template match="owner"> <xsl:value-of select="@id" /> <xsl:template> <xsl:template match="fellow"> <xsl:value-of select="@url" /> </xsl:template> .. but every time i cannot get the value of @url,could anyone know why? thanks a lot _________________________________________________________________ Add photos to your e-mail with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail 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
|