[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
RE: [xsl] using xsl to check for duplicate elements
Subject: RE: [xsl] using xsl to check for duplicate elements From: Pankaj Jain <pjain@xxxxxxxxxxx> Date: Thu, 25 Oct 2001 00:06:36 +0100 |
Does anyone know of some sort of memory leak in Xalan V2 on Solaris with JDK 1.3.1? I'm running the XSL below on a file more than 16MB and I'm getting the following error "XSLT Error (java.lang.OutOfMemory): null" Thanks Pankaj -----Original Message----- From: Jörg Heinicke [mailto:joerg.heinicke@xxxxxx] Sent: Tuesday, October 23, 2001 6:46 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] using xsl to check for duplicate elements One method is to test on preceding(-sibling) or following(-sibling) nodes: <?xml version="1.0"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes"/> <xsl:template match="Instruments|Equity"> <xsl:copy> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="*"> <xsl:if test="not(preceding-sibling::*[name()=name(current()) and text()=current()/text()])"> <xsl:copy-of select="."/> </xsl:if> </xsl:template> </xsl:stylesheet> Another method is to use keys for grouping with Muenchian Method: http://www.jenitennison.com/xslt/grouping/muenchian.xml. Joerg ----- Original Message ----- From: "Pankaj Jain" <pjain@xxxxxxxxxxx> To: "XSL List (E-mail)" <xsl-list@xxxxxxxxxxxxxxxxxxxxxx> Sent: Wednesday, October 24, 2001 12:19 AM Subject: [xsl] using xsl to check for duplicate elements > Hi all, > Is there a way to check an XML file for duplicate elements and eliminate the > second one? i.e. If I have the following XML: > > > <?xml version="1.0" standalone="yes"> > <Instruments> > <Equity> > <ISSUE_ID>108558</ISSUE_ID> > <RIC>IBM.N</RIC> > <CTRY_ID>648</CTRY_ID> > <EXCH_ID>224</EXCH_ID> > <NAME>IBM</NAME> > <EXCH_ID>224</EXCH_ID> > <ISSUE_ID>108558</ISSUE_ID> > <CTRY_ID>648</CTRY_ID> > </Equity> > </Instruments> > > > What would I do in XSL to create a new XML file that looks like the > following: > > <?xml version="1.0" standalone="yes"> > <Instruments> > <Equity> > <ISSUE_ID>108558</ISSUE_ID> > <RIC>IBM.N</RIC> > <CTRY_ID>648</CTRY_ID> > <EXCH_ID>224</EXCH_ID> > <NAME>IBM</NAME> > </Equity> > </Instruments> > > Thanks > Pankaj > > ----- > Pankaj Jain > > > ---------------------------------------------------- > This email with all information contained herein or attached hereto may > contain confidential and/or privileged information intended for the > addressee(s) only. If you have received this email in error, please contact > the sender and immediately delete this email in its entirety and any > attachments thereto.. > > > > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list ---------------------------------------------------- This email with all information contained herein or attached hereto may contain confidential and/or privileged information intended for the addressee(s) only. If you have received this email in error, please contact the sender and immediately delete this email in its entirety and any attachments thereto.. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
RE: [xsl] using xsl to check for du, Pankaj Jain | Thread | RE: [xsl] using xsl to check for du, Michael Kay |
Re: [xsl] methods of inserting html, David Carlisle | Date | Re: [xsl] ***********Transformation, Mark Nahabedian |
Month |