RE: [xsl] invalid xpath?

Subject: RE: [xsl] invalid xpath?
From: "Trevor Nicholls" <trevor@xxxxxxxxxxxxxxxxxx>
Date: Thu, 3 Jul 2008 01:26:50 +1200
It's probably worth noting that all three examples are supposed to be output
as

<code>
   abc<nl/>
   def<nl/>
</code>

i.e. "soft" newlines are inserted at the beginning and after each <nl/>.
This is done to aid human readability (as our humans are imperfect XML
parsers). OK, this isn't necessary nor pure, but it ought to be possible.

The original stylesheet (thru Saxon) did this nicely, i.e. it roundtripped.
Splitting the XPath expression into two conditions is not roundtripping
correctly, instead the output is gaining one space per line per invocation.

Cheers
Trevor

-----Original Message-----
<snip>
 we're looking at code samples where spaces are significant, and line breaks
are inserted into the text with <nl/> elements. The following three XML
fragments need to produce identical output:

<code>
   abc<nl/>
   def<nl/>
</code>

<code>   abc<nl/>   def</nl></code>

<code>   abc<nl/>
   def<nl/></code>

Current Thread