[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
[Recent Entries]
[Reply To This Message]
Re: get back from nodeset to root ?
Subject: Re: get back from nodeset to root ?
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Mon, 16 Dec 2002 18:46:26 +0100
|
Hello Heiko,
Heiko Specht wrote:
Hello all Mail list users,
I have a small (no its large) problem from getting results from a
nodeset and use them in them in the xml of the document root (or what
it is called).
I have created an variable which i called "astring" giving me (i do
there a lot of string commands) what i
wanted !!
<!-- this works perfect for me -->
<xsl:variable name="alllanguage" select="xalan:nodeset($astring)/all/artname"/>
<select name="A">
<xsl:for-each select="$alllanguage">
<xsl:if test="generate-id(.) = generate-id($alllanguage[.=current()])">
<option><xsl:value-of select="normalize-space()" /></option>
</xsl:if>
</xsl:for-each>
</select><br/><br/>
<!-- end of great work -->
What i want is to check if in my xml in the path
/page/article-list/article
<xsl:for-each select="$alllanguage">
<xsl:if test="generate-id(.) = generate-id($alllanguage[.=current()])">
<!-- works -->
<xsl:value-of select="normalize-space()" />
<xsl:variable name="thisname" select="normalize-space()" />
<!-- end of works -->
<!-- i want back into my xml document but no chance -->
<xsl:variable name="articelIds" select="/page/article-list/article"/>
you can simply move the variable declaration of articleIds outside of
this for-each.
<xsl:for-each select="$articelIds">
<!-- there is an element in this path called articleName -->
<xsl:if test="contains(articleName, $thisname)">
<xsl:value-of select="article_id"/><br/>
</xsl:if>
</xsl:for-each>
This can be simplified to
<xsl:for-each select="$articleIds[contains(acrticleName, $thisname)]">
<xsl:value-of select="article_id"/><br/>
</xsl:for-each>
Regards,
Joerg
</xsl:if>
</xsl:for-each>
I have search for so long, but couldn'd find the answer.
a little help would be great. TIA
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
RSS 2.0 |
|
Atom 0.3 |
|
|