xsl-list
[Top] [All Lists]

Re: Merging XML structure by comparing elements

2005-07-19 12:04:26
Karl,

At 01:59 PM 7/19/2005, you wrote:
Please keep in mind that for that the XSLT parser somehow would need to
"remember" that "...test text 1" has already been copied, so it always
avoids that this text is copied a second time somewhere later.

Actually the "XSLT Way" would be to decide which of the several copies you would want in such a case (since they're all the same it doesn't matter, so one ordinarily decides on the first), and simply copy that one and not the others.

So on inspecting each copy the question would not be "has one like you already been copied" but rather "are you the first (does one like you exist earlier in the document)". This converts the problem from one of tracking "state" in the transformation to simply a stateless query on the source -- which is what XSLT likes.

 Also please
keep in mind that my actual content consists of about 10000 nodes which is
an issue of complexity.

Well, generally performance isn't a problem, except when it is. 10000 nodes may not be very many. As you'll see from the helpful replies on this list, we usually use keys for de-duplication problems like this in XSLT 1.0 -- primarily because they are very efficient at such things.

I know this doesn't actually answer your question! but I also know there are many helpful contributors to this list.

Cheers,
Wendell


======================================================================
Wendell Piez                            
mailto:wapiez(_at_)mulberrytech(_dot_)com
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
======================================================================


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>