
Signature
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
Hi Dave,
As for the "Invalid high surrogate character" error you encountered, it is
due to some Unicode specific validation in .NET XML API. Within the .Net
framework, there are lot of string validations for Unicode, not only for
XML. So, this is the correct behaviour.The problem is that the data in the
XML you generated may contains some certain value that is valid in string
or XML, but not valid for UNICODE(utf-16 which has rules for surrogate).
From some former issue, I found that you may encounter this error when
you've encrypted some of the data in the xml which may cause the generated
value be invalid according to unicode surrogate pair rules. Is there any
particular data included in your XML document? You can try simplify the XML
document so as to locate the certain data fragment.
BTW, here is a blog article I've found which also mentioned this:
http://blogs.msdn.com/michkap/archive/2006/12/05/1212917.aspx
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= <thielen@nospam.nospam>
>Subject: Invalid high surrogate character (0xDEB6).
>Date: Wed, 6 Feb 2008 17:25:01 -0800
>I am building an XML document using the standard calls to create elements and
>attributes. Occasionally I get the following when calling xmlDoc.OuterXml.
[quoted text clipped - 27 lines]
> at System.Xml.XmlNode.get_OuterXml()
> at
net.windward.autotag.DocumentDataBuffer.SaveProfileToDoc(DocGlobal
>docData, String docFileName) in
>C:\src\kahuna\AutoTag\AutoTagCore\net\windward\autotag\DocumentDataBuffer.cs:line 116
David Thielen - 07 Feb 2008 05:05 GMT
My problem is I don't control the text that goes in many of the nodes &
attributes. Should I be encoding the text somehow? I assumed using the
XmlDocument methods that it would handle any necessary encoding.
Also, all of the text added in this case is ASCII.

Signature
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com
Cubicle Wars - http://www.windwardreports.com/film.htm
> Hi Dave,
>
[quoted text clipped - 88 lines]
> >C:\src\kahuna\AutoTag\AutoTagCore\net\windward\autotag\DocumentDataBuffer.c
> s:line 116
Steven Cheng[MSFT] - 08 Feb 2008 05:11 GMT
Thanks for your reply Dave,
I think it would be better to identify those nodes that may contains the
pontential problemtic data. Sure, you can perform an additional encoding on
the data so as to ensure it is proper unicode text range.
As you mentioned that all the data is of ASCII char, how were those ASCII
chars generated and embeded into the XML document?
Sincerely,
Steven Cheng
Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?= <thielen@nospam.nospam>
>References: <BEFB912D-04CF-4210-BEA8-5CBA8964E270@microsoft.com>
<JT7PTWUaIHA.1500@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: Invalid high surrogate character (0xDEB6).
>Date: Wed, 6 Feb 2008 21:05:01 -0800
>My problem is I don't control the text that goes in many of the nodes &
>attributes. Should I be encoding the text somehow? I assumed using the
[quoted text clipped - 32 lines]
>>
>> Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
>> ications.
>>
[quoted text clipped - 58 lines]
>C:\src\kahuna\AutoTag\AutoTagCore\net\windward\autotag\DocumentDataBuffer.c
>> s:line 116