xsl-list
[Top] [All Lists]

RE: [xsl] Detecting XML elements not transformed

2008-04-22 03:26:50
My suggestion would be to add a template rule such as

<xsl:template match="*">
  <xxx:untransformed-element>
    <xsl:copy-of select="."/>
    (or perhaps <xsl:apply-templates/>)
  </xxx:untransformed-element>
</xsl:template> 

This will add extra information into your output XML. You then put this
output XML through two further transformations, one of which copies only the
<xxx:untransformed-element> elements, the other copies everything except
these elements.

Michael Kay
http://www.saxonica.com/

-----Original Message-----
From: Harry Liljeström 
[mailto:harry(_dot_)liljestrom(_at_)saunalahti(_dot_)fi] 
Sent: 22 April 2008 08:06
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Detecting XML elements not transformed

Hi All,

I'm using Xalan-C version 1.10 and I have an input XML to be 
transformed to output XML.

In other words, I have an application with XML configuration 
3.x, which I upgrade to 4.x by using a XSL (v1.0) transform. 
All 3.x XML configuration elements are not supported in 4.x 
configuration. So, I would like somehow inform the user about 
those 3.x XML configuration elements which were not 
transformed during XSL transformation. The 3.x XML 
configuration is varying quite lot for different customers, 
so I would like to have a generally applicable way of 
detecting those 3.x XML configuration elements which were not 
transformed during upgrade. Is it possible to write a XSL 
template for this purpose?

Could I e.g. somehow have two output files, conf4x.xml and 
notsupported.xml? conf4x.xml would contain the upgraded 4.x 
XML and notsupported.xml would contain those 3.x XML elements 
which were not tranformed.

Does anybody have any ideas or examples of this?

Thanks in advance,

Harry

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



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