Altova Mailing List Archives

Re: [xsl] XHTML to XHTML transform

From: "Jeffrey Moss" <jeff@------------>
Date: 4/2/2004 10:03:00 AM
> Hi,
> Well, there are a number of possible approaches:
> - keep the general matching template as is, and add an empty template in
> which you specify which nodes are to be left alone:
> <xsl:template match="name | id | short-description | ..." />
> (I think this is your best shot if all of the source XML is in the same
> namespace, so the elements that are not to be processed have to be
> on an individual basis to be able to distinguish them from those you do
> processed.)
> - make sure the elements you *do* want templates to be applied to are
> already in the XHTML namespace in the source XML, and make the general
> template match pattern :
> <xsl:template match="*[namespace-uri()='']">
> Hope this helps!

Well now you bring up some great points, what if I name my <box> element
<mynamespace:box> ???
Does that make things easier?

The solution I came up with is to use parameters wherever possible, since I
wont need the empty template solution for that (although the option is
available if I ever want to use text nodes...).
but using the match *[namesapce-uri()=''] it
looks like I could only apply the copy template to elements not in the
"mynamespace:" namespace... is that right?



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.