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

Re: Outputing Differences between two files

Subject: Re: Outputing Differences between two files
From: Geert Josten <Geert.Josten@xxxxxxxxxxx>
Date: Mon, 18 Jul 2005 16:57:25 +0200
differences between two xml xsl
Hi Jonathan,

Use an index.

<xsl:key name="values" match="bb" use="string(.)" />

<xsl:template match="a">
  <xsl:if test="count(key('values', string(bb))) > 1">
    <xsl:copy>
      <xsl:copy-of select="@*|bbb" />
    </xsl:copy>
  </xsl:if>
</xsl:template>

Vary on this theme as you like...

Cheers,
Geert

Jonathan Marenus wrote:

I'm trying to write an XSL that receives an XML file
as input and outputs only the values that have a
certain sibling's value duplicated in the file.  For
example, if I have the following XML:

<a>
   <b>Value1</b>
   <bb>Value2</bb>
   <bbb>Value3</bbb>
</a>
<c>
   <b>Value4</b>
   <bb>Value2</bb>
   <bbb>Value5</bbb>
</c>

In this example, I want the output sibling to be
"a/bbb".  Since "Value2" is shown twice for element
bb, I want to output "Value3", since that is the
output sibling.  Any feedback regarding this example
would be appreciated, so that I can apply it to my
actual situation.

Thanks.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com




-- Geert.Josten@xxxxxxxxxxx IT-consultant at Daidalos BV, Bleiswijk (NL)

http://www.daidalos.nl/
tel:+31-(0)10-850 12 00
fax:+31-(0)10-850 11 99

GPG: 1024D/12DEBB50

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.