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

Re[2]: get back from nodeset to root ?

Subject: Re[2]: get back from nodeset to root ?
From: Heiko Specht <heiko@xxxxxxxxxx>
Date: Tue, 17 Dec 2002 11:24:29 +0100
get document root
Hello Joerg,

thanks for this info. i thought i got it with your first answer. but i
put this info in my brain too.

i think i have a lot more questions later. but i'll try to find out by
searching and reading and training. to get started with xsl and xpath
is sometimes a bit confusing - as long your only programminglanguage
was php and asp until xsl.

thanks again

Heiko

Tuesday, December 17, 2002, 11:05:52 AM, you wrote:

JH> Do you know why it is so? In your variable $alllanguage (created from a 
JH> RTF via node set function) you store a new document. With for-each 
JH> select="$alllanguage" you switch the context to this new document and 
JH> <xsl:variable name="articelIds" select="/page/article-list/article"/> is 
JH> evaluated in this document context, so it is searched for 
JH> /page/article-list/article and of course nothing is found.
JH> Outside of the for-each the context is still in the original document.

JH> Joerg

JH> Heiko Specht wrote:
>> Hello Joerg,
>> 
>> thanks, that helped pretty very much
>> some things seems so strange but are really easy.
>> 
>> regards
>> 
>> Heiko
>> 
>> Monday, December 16, 2002, 6:46:26 PM, you wrote:
>> 
>> JH> Hello Heiko,
>> 
>> JH> 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"/>
>> 
>> 
>> JH> you can simply move the variable declaration of articleIds outside of 
>> JH> 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>
>> 
>> 
>> JH> This can be simplified to
>> 
>> JH> <xsl:for-each select="$articleIds[contains(acrticleName, $thisname)]">
>> JH>    <xsl:value-of select="article_id"/><br/>
>> JH> </xsl:for-each>
>> 
>> JH> Regards,
>> 
>> JH> 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


JH>  XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


 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.