Altova Mailing List Archives

Re: [xml-dev] Dangers of Copying Text into an XML Document

From: noah_mendelsohn@--.---.---
To: "Costello, Roger L." <costello@-----.--->
Date: 9/5/2007 3:31:00 PM
Roger Costello writes:

> Can you think of other problems that may result from copying text from
> one document and pasting it into an XML document?

They might be characters that are not legal in XML at all.  See [1] which 

"Well-formedness constraint: Legal Character

Characters referred to using character references MUST match the 
production for Char."

In XML 1.0 that's:

"Char      ::=          #x9 | #xA | #xD | [#x20-#xD7FF] |
                [#xE000-#xFFFD] | [#x10000-#x10FFFF]    /* any Unicode 
                                                           excluding the 
                                                          blocks, FFFE, 
and FFFF. */" 

If you have any characters that don't fit this production, XML can't 
represent them, escaped or not.  XML 1.1 allows somewhat more, as I 



Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142


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 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.