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

SOLVED: xsl2 saxon8B stripping off unwanted sep

Subject: SOLVED: xsl2 saxon8B stripping off unwanted separation characters
From: jacques FAUQUEX <jacques@xxxxxxxxxxxxxxx>
Date: Fri, 7 Jul 2006 09:44:52 -0300
saxon8b
Thanks to all for so many answers.
Here come some observations:

multiple elements...
===============
My XML coded in
<?xml version="1.0" encoding="UTF-8"?>
follows the structure
...
<td class="lycee">
	<a href="http://www.yyy.com" target="_blank">
		Lycie Paul
		Cizanne</a>
</td>

Basically, it's a text taken from a web page, where
there is one and only one <a> element into a <td>.
The <a> element is compounded by attributes on the one
hand and by a text content on the other. The text is
spread on two lines.
In my first mail I copied only the las part of the Xpath.
Maybe I should precise that the Xpath is on more than one
level. Hence I rewrite here the examples with td/a instead
of a.

@Separator attribute in the xsl
===============================
<xsl:value-of separator=" " select="td/a"/>
The problem with xslt2 saxon8B stripping off unwanted
separation characters remains the same whether
there is or there isn't a @separator=" " in the xsl.
<xsl:value-of select=fn:normalize-space("td/a")/> generates
the same error

"A sequence of more than one item is not allowed as
the first argument of normalize-space()
URL: http://www.w3.org/TR/xpath20/#ERRXPTY0004"

fn:normalize-unicode()
====================
Same error as with fn:normalize-space()

Choosing the first element of <td/a>
================================
Micheal Kay's solution to replicate XSLT 1 behavior
in XSLT2 by writing <xsl:value-of select="td/a[1]"/>
doesn't solve the problem:

<xsl:value-of select="a[1]"/> shows the undesired
"&#xA;              " in the result
<xsl:value-of select="normalize-space(td/a[1])"/>
creates an error
"A sequence of more than one item is not allowed as
the first argument of normalize-space()
URL: http://www.w3.org/TR/xpath20/#ERRXPTY0004"

THE SOLUTION
============
--drkm gave the solution of the problem in his first
message
<xsl:value-of separator=" " select="td/a/normalize-space()"/>
works with Saxon8B
<xsl:value-of select="td/a/normalize-space()"/>
works as well

It is quite interesting to observe that this solution
doesn't work with Saxon6.5.5 or with Xalan

MY CONCLUSION
==============
For Saxon 6.5.5 and Xalan, normalize-space should
enclose the Xpath.
For Saxon 8B, normalize-space should be apended
to the Xpath.

Thanks a lot to all,
Best regards,
Jacques Fauquex

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.