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

document() and attribute

Subject: document() and attribute
From: "True Name" <bbengland@xxxxxxxxxxx>
Date: Tue, 10 Dec 2002 14:06:33 +0000
xsl document from 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



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.