xsl-list
[Top] [All Lists]

Re: [xsl] position() question

2008-09-26 09:50:25
2008/9/26 Michael Kay <mike(_at_)saxonica(_dot_)com>:
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/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>