Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xsl] iterate through nodes and determine output by node type

From: Mario Madunic <hajduk@-------->
To:
Date: 10/1/2007 5:07:00 PM
Abel,

I do mean 1.1. 2.0 would be preferable but can't use it in this project and like
to use <xsl:document />.

Thanks for the bit of code.

Marijan (Mario) Madunic

Quoting Abel Braaksma <abel.online@xxxxxxxxx>:

> Mario Madunic wrote:
> > I'd like to test all child elements of a body tag and wrap any text nodes
> (that
> > can contain child elements itself)in a p tag and <apply-templates /> to
> any
> > element nodes.
> >
> > Using XSLT 1.1
> 
> XSLT 1.1 never got further then "Early draft" status and has been 
> dropped completely many years ago. You probably either mean XSLT 2.0 or 
> XSLT 1.0. In the case of the latter, consider extending Scott's solution 
> with a pipeline like the following:
> 
> <xsl:template match="*" mode="make-lower">
>      <xsl:element name="{lower-case(local-name())}"<
>           <xsl:apply-templates select="node() | @*" />
>      </xsl:element>
> </xsl:template>
> 
> <xsl:template match="node() | @*" mode="make-lower">
>      <xsl:copy />
> </xsl:template>
> 
> This will effectively make all your names lowercase. Capture this into a 
> variable and re-apply to the original solution of Scott. Now you only 
> have to code for the lower case names. This solution is also available 
> in XSLT 1.0, but then you have to apply exslt:node-set or another 
> variant of that extension to the result set of your pipeline.
> 
> Cheers,
> -- Abel Braaksma


transparent
Print
Mail
Like It
Disclaimer
.

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 www.altova.com/list/index.html. 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.

.
.

transparent

transparent