[XSL-LIST Mailing List Archive Home]
[By Thread]
[By Date]
Re: [xsl] XML apparently cannot be used for general text markup: whitespace gripe
Subject: Re: [xsl] XML apparently cannot be used for general text markup: whitespace gripe From: "Chad Jones" <chad@xxxxxxxxxxxxxx> Date: Tue, 19 Mar 2002 22:01:57 +0200 |
Hi Paul, > XML has a rule : multiple adjacent whitespaces or linefeeds are > non-significant. However, you can change this behavior, by adding the > 'xml:space' attribute on a node with the 'preserve' value, in the DTD, like > this : > > <!ATTLIST listing xml:space (default|preserve) 'preserve'> This is exactly what I'm after since the HTML presentation will normalize any additional whitespace. Actually I would prefer an XSL solution but, since I have control of the DTD, this works for me. Ok, one problem with implementation: This works: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="whitespace.xsl"?> <book> <par xml:space='preserve'>Is his name really <first>John</first> <last>Doe</last>?</par> </book> But when I put the xml:space attribute in the DTD, it no longer works. Here is an example: <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="whitespace.xsl"?> <!DOCTYPE book [ <!ELEMENT book (par+)> <!ELEMENT par (#PCDATA|first|last)*> <!ATTLIST par xml:space (default|preserve) 'preserve'> ]> <book> <par>Is his name really <first>John</first> <last>Doe</last>?</par> </book> Any suggestions? - Chad XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] XML apparently cannot be , Paul Terray | Thread | Re: [xsl] XML apparently cannot be , Paul Terray |
Re: [xsl] Evaluating text from with, David N Bertoni/Camb | Date | [xsl] Re: Evaluating text from with, Dimitre Novatchev |
Month |