Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: New to XML

From: Peter Flynn <peter.nosp@-.--------.-->
To: NULL
Date: 12/14/2008 5:35:00 PM
Asger Joergensen wrote:
> Hi Peter
> 
> Peter Flynn wrote:
> 
>> Asger Joergensen wrote:
>> [...]
>>> Thes characters are not alowed in the text in XML files
>>> & " ' < >
>>> they are reserved for tags and they must be translated to
>>> &amp; &quot; &apos; &lt; &gt;
>> No, only & and < are forbidden in text unless escaped. The characters
>> " ' > are just text and do not require escaping, although > acquires a special meaning in a start-tag or end-tag, and " and ' are bound by rules of matching and nesting when used in attributes.
> 
> You are of cource right, BUT it is commen / good practise to escape
> all five.

Possibly. It depends what system you are writing for. If you are writing 
normal text, you probably want to avoid " and ' as quotes completely, 
and use real (curly) open-and-close quotes (single and double) and keep 
the ' for an apostrophe. The > occurs very rarely in normal text. When 
used in its mathematical sense, it will of course be inside some kind of 
<math> element; either way it is a matter of personal preference whether 
you use it raw or in the form of a character reference.

> http://www.w3schools.com/xml/xml_syntax.asp

The W3Schools pages are not always reliable or accurate (these ones are OK).

///Peter


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent