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

 


Help: OASIS Mailing Lists Help | MarkMail Help

 


 

   Re: [xml-dev] Default Entity when compose xml file

[ Lists Home | Date Index | Thread Index ]

Hi,

> One solution I am thinking about is:
> Replace <,>,& and other characters that can not used
> directly in xml data with &lt;, &gt;,&amp; and etc in
> the data before I compose the xml file.
> 
> An other problem is risen here. Are these entities
> been defined as default entity in the parser (Xerces)?
> I.e.: can I do not define these entities in the xml
> file?

The entities for the XML meta-characters (&amp; &gt; &lt; &quot; &apos;)
are part of the XML standard itself and always available in XML
documents/parsers. So no need to worry, you can just replace occurrences
of the characters with the appropriate entity.

Make sure you replace the '&' character first, as you will run into ugly
double escaping problems otherwise. You also only need to escape & and <
in element content, the others are optional.

Martin





 

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

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