[xsl] document() and attribute

Subject: [xsl] document() and attribute
From: "True Name" <bbengland@xxxxxxxxxxx>
Date: Tue, 10 Dec 2002 14:06:33 +0000

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