
Hi again -- Indeed the problem was related to an xsl:import, which I hadn't traced sufficiently carefully -- sorry for the noise, and the distraction! Cheers, Wendell On Mon, Jun 29, 2015 at 10:51 AM, Wendell Piez <wapiez@wendellpiez.com> wrote:
Dear Jirka and George,
You guys are absolute correct - and I even knew that - unfortunately as it happens the real-life bug is in processing a separate file ... I thought I'd duplicated it but I guess I was actually demonstrating a "feature". :->
Thanks anyhow (I will look back at the offending stylesheet) --
Cheers, Wendell
On Fri, Jun 26, 2015 at 2:41 AM, Jirka Kosek <jirka@kosek.cz> wrote:
On 26.6.2015 5:49, George Bina wrote:
I think that is removed by step 3 in http://www.w3.org/TR/xslt20/#stylesheet-stripping
Exactly. One has to keep in mind that rules for whitespace stripping are different for input XML documents and for XSLT stylesheets. Usually this works in an intuitive way, but once XML data are put inside XSLT stylesheet it can produce unexpected behaviour.
In Wendell's case, easy fix would be using xml:space="preserve":
<xsl:variable name="mixed" as="element()"> <mixed xml:space="preserve">Here is mixed content, including
<one>children</one> <two>with nothing</two>
but whitespace between them.</mixed> </xsl:variable>
Also please note that xml:space can't be put on xsl:variable in this case as text node before <mixed> would break type annotation.
Jirka
-- ------------------------------------------------------------------ Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz ------------------------------------------------------------------ Professional XML and Web consulting and training services DocBook/DITA customization, custom XSLT/XSL-FO document processing ------------------------------------------------------------------ OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep. ------------------------------------------------------------------ Bringing you XML Prague conference http://xmlprague.cz ------------------------------------------------------------------
-- Wendell Piez | http://www.wendellpiez.com XML | XSLT | electronic publishing Eat Your Vegetables _____oo_________o_o___ooooo____ooooooo_^
-- Wendell Piez | http://www.wendellpiez.com XML | XSLT | electronic publishing Eat Your Vegetables _____oo_________o_o___ooooo____ooooooo_^