Re: [xml] Premature end of data in tag



On Tue, 10 Dec 2002, Rich Salz wrote:

when I try to parse a xml file with tags containing special characters
(like CONTROL-M) I get an error "premature end of data in tag <tag name>".

  yes it's not XML. The parser MUST stop its work and report a fatal error
the set of acceptable characters in XML is described in the spec:

   http://www.w3.org/TR/REC-xml#NT-Char

That URL says that valid Char is

Char    ::=    #x9 | #xA | #xD | [#x20-#xD7FF] |
   [#xE000-#xFFFD] | [#x10000-#x10FFFF]

As such, the 8-bit characters Filippo referred to are valid. Or have I
missed something?

Daniel probably meant NT-NameChar, not NT-Char.  Look at EBNF productions
[5] and [4].  The special characters are not valid XML element names.
        /r$

In my case, the offending character is inside a CDATA section which allows
Char.

http://www.w3.org/TR/REC-xml#dt-cdsection

   [20]    CData    ::=    (Char* - (Char* ']]>' Char*))

Gavin




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]