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

Re: How can the mere switch from DTD to XSD in the sou

Subject: Re: How can the mere switch from DTD to XSD in the source document affect how a stylesheet handles white space?
From: "Wolfhart Totschnig wolfhart.totschnig@xxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 22 Feb 2021 20:54:22 -0000
Re:  How can the mere switch from DTD to XSD in the sou
Dear Martin,

Thank you for the prompt reply!

To answer your questions:

1) When doing these tests, I ran Saxon with the following command:

java -cp "/home/wolfhart/Programs/Saxon/saxon9he.jar" net.sf.saxon.Transform -s:Test.xml -xsl:Test.xsl -o:Test.txt

2) Yes, the content of the <author> element is element-only.

So this is a Saxon-specific issue? Another processor might produce a different result? (I checked the second example -- the one with the XSD -- with the online XSL processor at https://www.freeformatter.com/xsl-transformer.html and it produced the same result as Saxon.) If so, I am a little surprised that there is no correct or standard way of handling white space in such cases (i.e., in the absence of an explicit <xsl:strip-space/>).

Wolfhart


On 22-02-21 16:49, Martin Honnen martin.honnen@xxxxxx wrote:
On 22.02.2021 20:41, Martin Honnen martin.honnen@xxxxxx wrote:

How exactly do you run Saxon? I think it might depend on the behaviour
of the underlying parser and I am not sure Saxon HE, as it itself does
not support schema-aware XSLT, uses any xsi:schemaLocation hint or
passes it to the XML parser, so basically the schema is ignored, while
the default setting for XML based parsing might use a parser reading and
taking the DTD into account. I would expect Saxon EE with
schema-validation turned on for parsing to give a different output for
the second sample.

The relevant option from the command line


https://www.saxonica.com/html/documentation9.9/using-xsl/commandline/

might be "-strip:(all|none|ignorable)"


Specifies what whitespace is to be stripped from source documents (applies both to the principal source document and to any documents loaded for example using the document() function). The default is ignorable: all ignorable whitespace is stripped. Whitespace text nodes are ignorable if they appear in elements defined in the DTD or schema as having element-only content.


I guess in your case the DTD defines element only content for the author element and Saxon and/or the parser used the DTD while the schema, even if it defines the same, was not applied during parsing.

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.