XML Editor
Sign up for a WebBoard account Sign Up Keyword Search Search More Options... Options
Chat Rooms Chat Help Help News News Log in to WebBoard Log in Not Logged in
Show tree view Topic
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Postnext
Ngai ZhangSubject: Finding Duplicate IDs in XML document using XSL
Author: Ngai Zhang
Date: 06 Jun 2006 02:12 PM
Originally Posted: 06 Jun 2006 02:08 PM
In the XML document, there are ID's that are duplicates, and I'm trying use XSL to find ID's that aren't unique, so that I can highlight them for the user.

I'm trying to use variable items in XSL, but when I use xsl:value-of, the output doesn't show up in Internet Explorer.

<xsl:variable name="myArray">
<xsl:for-each select="StagingInformation/MachineInformation">
<item><xsl:value-of select="ID"/></item>
</xsl:for-each>
</xsl:variable>

##### This line below is my test that won't work

<xsl:value-of select="$myArray/item[2]"/>

##### (These comments are not in code)
##### end

<xsl:for-each select="myArray/item">
<xsl:variable name="count1">position()</xsl:variable>
<xsl:for-each select="myArray/item">
<xsl:variable name="count2">position()</xsl:variable>
<xsl:if test="$myArray/item[$count1] = $myArray/item[$count1]"/>
</xsl:for-each>
</xsl:for-each>


Can anyone help?

Posttop
Ivan PedruzziSubject: Finding Duplicate IDs in XML document using XSL
Author: Ivan Pedruzzi
Date: 06 Jun 2006 04:13 PM
Please before posting search the forum, most likely someone already asked a similar question.

Search for the word duplicates, there are many examples.

Hope this helps
Ivan Pedruzzi
Stylus Studio Team

 
Topic Page 1 2 3 4 5 6 7 8 9 Go to previous topicPrev TopicGo to next topicNext Topic
Download A Free Trial of Stylus Studio 6 XML Professional Edition Today! Powered by Stylus Studio, the world's leading XML IDE for XML, XSLT, XQuery, XML Schema, DTD, XPath, WSDL, XHTML, SQL/XML, and XML Mapping!  
go

Log In Options

Site Map | Privacy Policy | Terms of Use | Trademarks
Stylus Scoop XML Newsletter:
W3C Member
Stylus Studio® and DataDirect XQuery ™are from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2016 All Rights Reserved.