OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   "Save as XML"

[ Lists Home | Date Index | Thread Index ]
  • From: David Megginson <ak117@freenet.carleton.ca>
  • To: xml-dev Mailing List <xml-dev@ic.ac.uk>
  • Date: Fri, 6 Feb 1998 09:53:13 -0500

Peter Murray-Rust writes:

 > I have a problem to know what to do with "save XML" on JUMBO. In
 > the SAXDemo routine characters(), DavidM converts non printing
 > chars to escaped variants *e.g. asc(10) -> &#10; , but does *not*
 > convert & to &amp; This means that any XML file that contains &
 > will produce invalid XML output.

Sorry for any confusion there -- I had originally used '\n' and '\r',
then decided to use character references to be more XML-like.  I
realise, though, that that gives the unintended appearance of an
attempt to produce XML-parseable character data.  Perhaps I should go
back to C-like escapes.

 > What is the appropriate strategy? Should a "save XML" application
 > convert all five chars (&, <, >, ', ") to their escaped
 > equivalents? Or none? Or just the first two. [In my own community I
 > don't think using <![CDATA[ is a good idea because people won't
 > have any idea what is going on and they will get it wrong.  In any
 > case - as pointed out - it doesn't overcome the random occurrence
 > of ']]>' ].

This taps into an earlier discussion about what is an is not
significant information in an XML document.  For example, if the
general entity &name; is set to "David Megginson", then the following
two fragments are exactly equivalent for many XML applications:

FRAGMENT 1:

  <x


  y="z">My name is<--

  here's a comment


  --> &name;.</x>


FRAGMENT 2:

  <x y="z">My name is David Megginson.</x>


Some authoring and repository tools, however, will want to preserve
the general entity reference, the comment, and the whitespace (even
inside the start tag).  In SGML, you can use grove plans to specify
what information is and is not significant to an application -- but
there is still a lack of detailed standards for the information set
(or sets) returned by an XML parser.


All the best,


David

-- 
David Megginson                 ak117@freenet.carleton.ca
Microstar Software Ltd.         dmeggins@microstar.com
      http://home.sprynet.com/sprynet/dmeggins/

xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@ic.ac.uk
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:majordomo@ic.ac.uk the following message;
(un)subscribe xml-dev
To subscribe to the digests, mailto:majordomo@ic.ac.uk the following message;
subscribe xml-dev-digest
List coordinator, Henry Rzepa (mailto:rzepa@ic.ac.uk)





 

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 2001 XML.org. This site is hosted by OASIS