[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: iterate through nodes and determine output by node

Subject: Re: iterate through nodes and determine output by node type
From: Mario Madunic <hajduk@xxxxxxxx>
Date: Mon, 1 Oct 2007 10:06:10 -0700
Re:  iterate through nodes and determine output by node
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Cast Your Vote

We need your help – Vote for DataDirect XML Products!

  • Best SOA or XML site

Winners and finalists announced at SOA World Conference in November.

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.