Subject: Re: [xsl] Comparing nodes minus one child From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> Date: Fri, 28 Sep 2001 14:44:36 -0400 |
Cheers, Wendell
Assume that I have two collections of elements <A>(stored in variables) that I have gotten from two different files. The collections look something like the following <HOLDER> <A> <B>..</B> <C>..</C> ... <X>..</X> </A> </HOLDER>
I want to see if each of the <A> elements in the <HOLDER>(from first collection) equals an <A> in the <HOLDER>(from the second collection), but I want the comparison to only include the <A> with all of its children EXCEPT the <X> element. My goal is to output the entire <A> element (including the <X> element).
I can get rid of the <X> elements by calling the following templates: <xsl:template match="node()|@*" mode="remove"> <xsl:copy> <xsl:apply-templates select="node()|@*" mode="remove"/> </xsl:copy> </xsl:template> <xsl:template match="X"mode="remove"> <!-- do nothing, we don't want this element in the result --> </xsl:template>
I know that I can convert each set of <A> elements in both collections to the compressed version. Then I would have to iterate through all of the original <A> elements, compressing that individually, and then comparing it to the results of the compress second collection. (I also need to do it going through the second list as well, since I am doing Adds, Deletes, etc.). Is there a way to do this more effiently?
====================================================================== Wendell Piez mailto:wapiez@xxxxxxxxxxxxxxxx Mulberry Technologies, Inc. http://www.mulberrytech.com 17 West Jefferson Street Direct Phone: 301/315-9635 Suite 207 Phone: 301/315-9631 Rockville, MD 20850 Fax: 301/315-8285 ---------------------------------------------------------------------- Mulberry Technologies: A Consultancy Specializing in SGML and XML ======================================================================
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Comparing nodes minus one, mjyoungblut | Thread | [xsl] Equals (=), mjyoungblut |
Re: [xsl] Is there a XSL XSD?, gmckessock | Date | [xsl]: How to handle two XML source, Uronis, Jeremy |
Month |