Altova Mailing List Archives

Re: [xsl] Filtering new tags using XSL

From: Wendell Piez <wapiez@---------------->
Date: 9/13/2007 3:32:00 PM

Taking off from Mukul's and Abel's observations, one approach could 
be a transformation that would take two inputs.

The primary input would be the new (edited) file.

A secondary input would be the old file, before editing.

(If you no longer have that file, you're in trouble.)

One would have to presume that a data element appearing in the new 
file, which did not occur identically in the old file, would be new. 
To implement this, you would have to define "identical". For example, 
what if whitespace were entirely altered in the new file? (Maybe the 
editor had changed the indenting level.) Would this make all the entries "new"?


At 09:15 AM 9/13/2007, you wrote:
Buddhi Dananjaya wrote:

My customer may add new <data></data> blocks into this file, not 
always at the bottom (here and there) can anyone suggest a XSL 
format ( prefer sample code) to filter out  newly added blocks..I 
need to get a new xml file which will contain new <data> blocks 
after transformation.

If you look at the data that he (your customer) provides, in what 
way can you, visually, distinguish new from old? And once you know 
it visually, how do you know it determinantly and evidently? In 
general, if you as a human cannot see the new from the old, then the 
computer won't be able to do so either.

To resolve this: either use a record of processed items or use a 
different data structure (like Mukul suggested: add a timestamp (but 
that is awkward when you are stuck with XSLT 1.0, I hope you can use 
2.0 for that)).

-- Abel Braaksma

Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
Mulberry Technologies, Inc.      
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


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 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.