Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


[xsl] one more issue on removing dup records

From: "Wei Chin" <wei_chin@----------->
To:
Date: 3/3/2007 3:27:00 PM
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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent