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

Re: normalize-space and newlines

Subject: Re: normalize-space and newlines
From: "Trevor Nicholls" <trevor@xxxxxxxxxxxxxxxxxx>
Date: Wed, 24 Aug 2005 18:10:50 +1200
xslt normalize space
> Date: Wed, 24 Aug 2005 00:32:28 -0400
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> From: david_n_bertoni@xxxxxxxxxx
> Subject: Re:  normalize-space and newlines
> Message-ID: <OF8DBA1050.3B254F3A-ON88257067.00172602->
88257067.00191C5B@xxxxxxxxx>

Hi David, thanks for your help.

> This template has no "mode" attribute, so it's never matched.
>  This brings up the question as to why you are using modes at all,
> when all of your templates have apply-templates instructions that
> all use the same mode.

Um, because I don't know what I'm doing :-)
I copied somebody's identity template and it used mode="copy" throughout.
I added the normalize-space in a template matching text() items because it
looked like I could do it in the same pass (and I can, just not the way I
was doing it; I presumed that setting a higher priority would be enough).

>> <!-- non-empty: has children, is a text node, has value or attribute -->
>> <xsl:if test="node() or * or text() or string(.) or @*">

> The expression of the xsl:if "test" attribute seems strange to me.

And to me, it got to be what it was because terser expressions always seemed
to let stuff through that I didn't want to keep.

> Is there any reason why you don't have a separate template for element
nodes?
> <!-- Drop any empty elements -->
> <xsl:template match="*[not(node())]" mode="copy" />

I tried this with match="not(node())" which did not do what I wanted. Didn't
try *[note(node())] because expressions like that don't seem to occur to me
yet :-(

Cheers
Trevor

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

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

Buy Stylus Studio Now

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-2013 All Rights Reserved.