This is the mail archive of the
docbook@lists.oasis-open.org
mailing list for the DocBook project.
DocBook XSL stylesheet loses whitespace with MSXML
- From: Kevin Yank <kevin at sitepoint dot com>
- To: docbook at lists dot oasis-open dot org
- Date: Fri, 04 Oct 2002 00:28:48 +1000
- Subject: DOCBOOK: DocBook XSL stylesheet loses whitespace with MSXML
- Organization: SitePoint.com
I'm running into some whitespace issues with the MSXML parser and the
standard XSL stylesheet for converting DocBook to HTML.
Consider the following sample DocBook document:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book SYSTEM
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
<book>
<chapter>
<title>Test</title>
<screen><prompt>C:\></prompt><userinput>dir</userinput>
<prompt>C:\></prompt>exit</screen>
</chapter>
</book>
When using the Saxon XSL processor to transform this to HTML according
to the standard XSL stylesheet from http://docbook.sourceforge.net, the
output of the <screen> element looks like this on the page:
C:\>dir
C:\>exit
If instead I use the MSXML processor (e.g. by adding an
<?xml-stylesheet?> processing instruction to the file and loading it in
Internet Explorer), the output looks like this:
C:\>dirC:\>exit
>From tinkering with the test document, it seems like MSXML is dicarding
any whitespace-only text nodes in the <screen> element.
Can anyone explain this behaviour? Can anyone suggest a
modification/extension to the standard XSL stylesheet for DocBook that
would prevent this from happening? I've been at this for hours and have
been unable to figure out what's tripping up MSXML.
___________________________________
Kevin Yank
Technical Business Director
SitePoint.com - Master the Web!
e: kevin@sitepoint.com
w: www.sitepoint.com
p: +61 3 9495 6622
___________________________________