Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
821 views
in Technique[技术] by (71.8m points)

xml - hexadecimal 0X19 is an invalid character

SO,

I am building XML string based on the values from the dataset using XMLWriter.

It is properly building the xml string as per the settings and the conditions I specified.

If there are more than 1000 records in the dataset and when I try to build the xml string I am getting the above error. hexadecimal 0X19 is an invalid character

How do I get pass this. I have spent around 6 hrs trying to figure out.

Please help

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Quite simply, you're not allowed that character in an XML document, no matter how you mark it up. To quote the spec:

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

Roughly translated, that means that before 0x20, you're only allowed tab (0x09), newline (0x0a) and carriage return (0x0d).

The normal way to overcome this sort of issue to use another, embedded, encoding like base64.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

56.8k users

...