|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XML apparently cannot be used for general text ma
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








