[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Using id() when id and idref are in 2 different fi
Thanks! Now it works! > > If your documents are > <xsl:value-of name="doc1" select="document('1.xml')"/> I guess this should have been xsl:variable rather than xsl:value-of? > <xsl:variable name="x" select="@ref"/> > <xsl:for-each select="$doc1|$doc2|$doc3"> > <xsl:apply-templates select="id($x)"/> > </xsl:for-each> I have only 1 document but I'd imagine that the purpose of xsl:for-each here is to set the context node? Now I have the values all bunched together and unformatted. So I changed apply-templates to value-of and tried to use another for-each loop for each value but it doesn't seem to like me nesting it in the other loop. I get errors about the otherwise statement they are all inside. XML Parsing Error: mismatched tag. Expected: </xsl:otherwise>. <xsl:template match="move"> <p> <em> <xsl:choose> <xsl:when test="(@type = 'Exit') and not (@who)"> Exeunt </xsl:when> <xsl:otherwise> <xsl:value-of select="@type" />: <xsl:variable name="cast" select="document('front.xml')" /> <xsl:variable name="who" select="@who" /> <xsl:for-each select="$cast"> <xsl:for-each select="id($who)" /> <xsl:value-of select="id($who)" />, </xsl:for-each> </xsl:for-each> </xsl:otherwise> </xsl:choose> </em> </p> </xsl:template> Have I lost the plot sat at home with my cold and newbie brain? Or is there an alternative to setting the context instead of for-each? I guess this has taken up a lot of emails today for everyone and if that is the case please feel free to point me with a suggested search term to use with the archives or Google. Many thanks to everyone that has replied so far.
|
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
|