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

Re: regarding unique nodes in a nodelist-variable

Subject: Re: regarding unique nodes in a nodelist-variable
From: Joerg Heinicke <joerg.heinicke@xxxxxx>
Date: Mon, 30 Dec 2002 05:13:13 +0100
childelement
Hello Laura,

you can test your code in a simple way: add the expected structure into an XML file and the XSL code to a simple XSL file:

<xsl:template match="/">
<xsl:for-each select="/elements/element[not(parent/childelement = preceding-sibling::element/parent/childelement)]">
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:template>


You will see that it works like expected. And it's a must, that it works in the same way with variables. The problem can be the implementation of the nodeset() function. It's an extension and so not conform to any specification beside the implementer's one. Extension function should be avoided therefore where possible. What for are you using it? Maybe it's simpler to work without it and use a grouping mechanism like Muenchian Grouping.

Regards,

Joerg

Laura wrote:
Hello all,
This is regarding the sorting on unique nodes. I am using the axis method to
sort it.
eg..
not( parent/child = preceding-sibling::parent/child)

now if i have to go through a nodelist and sort.. can i use the same thing?
like
<xsl:for-each
select="xalan:nodeset($MyElementSet)/elements/element[not(parent/childelemen
t = preceding-sibling::element/parent/childelement)]/>

The structure of the xml in the variable:

<elements>
 <element>
   <parent>
    <childelement>child1</childelement>
   <parent>
 </element>
<element>
   <parent>
    <childelement>child2</childelement>
   <parent>
 </element>
<element>
   <parent>
    <childelement>child1</childelement>
   <parent>
 </element>
</elements>
is this valid? Its not working ..
thanks



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.