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

one more issue on removing dup records

Subject: one more issue on removing dup records
From: "Wei Chin" <wei_chin@xxxxxxxxxxx>
Date: Sat, 03 Mar 2007 10:26:53 -0500
 one more issue on removing dup records
Hi Mukul,

i just spot one thing that was due to a missing point in my business rule description, regarding the concatenation of ";headlines;" for the "display_on" attribute.

some releases do not need to have ";headlines;" to be added in the "display_on" attribute.

i tried to make changes on the solution you gave me below but i was not successful. here is what i have revised on your solution:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="node() | @*">
<xsl:copy>
<xsl:apply-templates select="node() | @*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="release[@display_on = 'headlines;'][fcc_doc_number = ../release[not(@display_on = 'headlines;')]/fcc_doc_number]">
<xsl:attribute name="display_on"><xsl:value-of select="concat(., ';headlines')"/></xsl:attribute>
</xsl:template>


<xsl:template match="release[@display_on = 'headlines;'][normalize-space(fcc_doc_number) = '']">
<xsl:copy-of select="."/>
</xsl:template>
</xsl:stylesheet>


it simply did not append ";headlines:" to all "display_on" attributes.
here is the sample file i am trying to work on, notice release id 19:

<?xml version="1.0" encoding="UTF-8"?>
<releases xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Data group A -->
<release id="2" name="Chairman Bureau" display_on="headlines;" type="NEWS RELEASE">
<fcc_doc_number>6</fcc_doc_number>
</release>
<release id="4" name="Wireless Telecommunications Bureau" display_on="headlines;" type="PUBLIC NOTICE">
<fcc_doc_number>5</fcc_doc_number>
</release>
<release id="6" name="Georgia Pacific Corporation" display_on="headlines;" type="ORDER">
<fcc_doc_number>4</fcc_doc_number>
</release>
<release id="8" name="Garmin International" display_on="headlines;" type="ORDER">
<fcc_doc_number>3</fcc_doc_number>
</release>
<release id="10" name="Wireless Telecommunications Bureau" display_on="headlines;" type="PUBLIC NOTICE">
<fcc_doc_number>2</fcc_doc_number>
</release>
<release id="12" name=" Wireless " display_on="headlines;" type="PUBLIC NOTICE">
<fcc_doc_number />
</release>
<!-- Data group B -->
<release id="14" name="In the Matter of Applications" display_on="uls" type="MEMORANDUM OPINION AND ORDER">
<fcc_doc_number>5</fcc_doc_number>
</release>
<release id="16" name="Auction of FM" display_on="asas" type="PUBLIC NOTICE">
<fcc_doc_number>4</fcc_doc_number>
</release>
<release id="18" name="Modification of Ex Parte Status" display_on="asr" type="PUBLIC NOTICE">
<fcc_doc_number>3</fcc_doc_number>
</release>
<release id="19" name="Modification of Ex Parte Status" display_on="poc" type="ORDER">
<fcc_doc_number>13</fcc_doc_number>
</release>
</releases>


and here is the desried resulting file, noltice release id 19:
<releases xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!-- Data group A -->
<release id="2" name="Chairman Bureau" display_on="headlines;" type="NEWS RELEASE">
<fcc_doc_number>6</fcc_doc_number>
</release>
<release id="10" name="Wireless Telecommunications Bureau" display_on="headlines;" type="PUBLIC NOTICE">
<fcc_doc_number>2</fcc_doc_number>
</release>
<release id="12" name=" Wireless " display_on="headlines;" type="PUBLIC NOTICE">
<fcc_doc_number/>
</release>
<!-- Data group B -->
<release id="14" name="In the Matter of Applications" display_on="uls;headlines;" type="MEMORANDUM OPINION AND ORDER">
<fcc_doc_number>5</fcc_doc_number>
</release>
<release id="16" name="Auction of FM" display_on="asas;headlines;" type="PUBLIC NOTICE">
<fcc_doc_number>4</fcc_doc_number>
</release>
<release id="18" name="Modification of Ex Parte Status" display_on="asr;headlines;" type="PUBLIC NOTICE">
<fcc_doc_number>3</fcc_doc_number>
</release>
<release id="19" name="Modification of Ex Parte Status" display_on="poc" type="ORDER">
<fcc_doc_number>13</fcc_doc_number>
</release>
</releases>



Thank you and have a nice day!


Best Regards,

Wei Chin

_________________________________________________________________
The average US Credit Score is 675. The cost to see yours: $0 by Experian. http://www.freecreditreport.com/pm/default.aspx?sc=660600&bcd=EMAILFOOTERAVERAGE


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.