[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

Subject: Re: 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
par xml
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

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.