Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / September 2004

Tip: Looking for answers? Try searching our database.

Ampersands in the result, xmldatadocument

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Bartosik MSFT MVP - 03 Sep 2004 16:41 GMT
I am returning an XMLDataDocument in my service since my client cannot
consume the dataset. The resulting XML does not replace ampersand characters
in the string values with & - for example -

<field>David & David</field>

The clients parser chokes on that. Is there something I can do with the
XMLDataDocument to replace such characters?

Signature

David Bartosik - MS MVP
www.publishermvps.com

Steven Cheng[MSFT] - 04 Sep 2004 08:25 GMT
Hi David,

As for the XmlDataDocument, generally if you are using .net framework at
both client and serverside, it'll auto escape and descape those characters.
What's the client you used to consume the webservice? In addition, I think
you can try using the CDataSection to wrapper the certain field which may
contain those charaters. We can use the XmlDataDocument's
"CreateCDataSection" method to create a XmlCDataSection and insert into the
document.

#XmlCDataSection Class
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemxmlxmldatadocumentclasstopic.asp

#XmlDocument.CreateCDataSection Method
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
frlrfsystemxmlxmldatadocumentclasstopic.asp

Regards,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

David Bartosik - MSFT MVP - 04 Sep 2004 17:58 GMT
The client is using Axis. Java. I tried a typed dataset but they don't seem
to know what they would need to do with that so that's why I'm trying the
XML now. But they now say their parser chokes on any special characters.
Is this your only suggestion ?

Signature

David Bartosik MS MVP
www.davidbartosik.com
www.barvin.com

> Hi David,
>
[quoted text clipped - 7 lines]
>
> #XmlCDataSection Class

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> frlrfsystemxmlxmldatadocumentclasstopic.asp
>
> #XmlDocument.CreateCDataSection Method

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/
> frlrfsystemxmlxmldatadocumentclasstopic.asp
>
[quoted text clipped - 6 lines]
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
Steven Cheng[MSFT] - 07 Sep 2004 10:47 GMT
Hi David,

As for the special characters, I think it is likely due to the different
implementing on soap message  of the axis and .net framework webservice. If
both the client and server use the .net framework the speical characters
will be processed correctly internally. But as for the axis, since it is
not designed right compatible with .net , I think it better to use CData
Section to ensure the text data be escaped.

Regards,

Steven Cheng
Microsoft Online Support

Signature

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

David Bartosik - MSFT MVP - 07 Sep 2004 16:50 GMT
ok, thanx.

Signature

David Bartosik
Microsoft MVP
www.davidbartosik.com

> Hi David,
>
[quoted text clipped - 14 lines]
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.