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

Re: position() question

Subject: Re: position() question
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 26 Sep 2008 14:49:50 +0100
Re:  position() question
2008/9/26 Michael Kay <mike@xxxxxxxxxxxx>:
>> The "solution" to the problem is either:
>>
>> a) tell the Microsoft parser not strip the whitespace only text nodes
>>
>> or
>>
>> b) be more explicit in the apply-templates call to only
>> process elements eg <xsl:apply-templates select="*"/>
>
> or (c) tell all processors that you aren't interested in the whitespace by
> using <xsl;strip-space elements="*"/>
>

You have to be a bit careful with (c)

<xsl:strip-space elements="*"/>

because when an element has mixed content such as:

<p> this is <strong>great</strong> <a>click here</a></p>

...the single space between <strong> and the <a> will also get
stripped, giving you this:

"this is greatclick here"

(unless the xml was validated and that element was marked as having
mixed content)


-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

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.