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

Categories

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

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

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...