W3C home > Mailing lists > Public > html-tidy@w3.org > October to December 2002

RE: tidy, indentation and XML/SGML rules

From: Howard, Kipp (LNG-CL) <Kipp.Howard@lexisnexis.com>
Date: Fri, 11 Oct 2002 10:09:29 -0700
Message-ID: <5150922C4A9FFE4DA2F658016BF9FA3C72BEA4@lnxseamail01.internal.courtlink.com>
To: "'Fred.Bone@dial.pipex.com'" <Fred.Bone@dial.pipex.com>, html-tidy@w3.org

Fred Bone [mailto:Fred.Bone@dial.pipex.com] wrote:
> > My problem is that tidy breaks lines between elements, like this :
> > <elem1><elem2>Content of elem2
> > is changed to
> > <elem1>
> >   <elem2>Content of elem2
> > 
> > The result is far easier to read, but...
> > the content of the document has been _changed_ : the newline between
> > <elem1> and <elem2> has been added.
> 
> I'm no expert on XML, but as far as I can tell this would only be a 
> change of content if you have elem1 defined with 
> xml:space='preserve', and then only the blanks would be significant 
> (and not the newline). The HTML4.1 spec says (appendix B.3.1):
> > SGML (see [ISO8879], section 7.6.1) specifies that a line break
> > immediately following a start tag must be ignored
> and this should, AIUI, also be true in XML (though I can't find 
> anything in the XML spec corresponding to what I've quoted from the 
> HTML one).

The closest ting I could find in the XML spec was: 

"An XML processor must always pass all characters in a document that are not
markup through to the application."
http://www.w3.org/TR/2000/REC-xml-20001006#sec-white-space


Here is how one XML Application (XSLT) deals with the white space:

http://www.w3.org/TR/xslt#strip

-- 
Kipp E. Howard - Sr. Software Engineer @ LexisNexis CourtLink
kipp.howard.nospam@lexisnexis.com   
(425) 372-1837 or (800) 774-7317 ext 1837
 
Received on Tuesday, 29 October 2002 18:36:16 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 5 February 2014 23:39:48 UTC