473,657 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Advise, Guidance and Pointers with XML

Dear Ethernet of Unquestionable Knowledge,

Re: Advise, Guidance and Pointers with XML

Oh omnipotent one(s) please help me ... I'm reasonably new to all the
XML stuff and although clear on the basic concepts of XML, however I'm
experiencing some difficulties in understanding how to implement and
utilise these concepts within a real world solution.

(1) Serialization

(a)

When I serialize my class object(s) the returning XML contains a random
character(s) at the beginning of the document. Do you have any idea why
this may be occurring? I.e.

?Encoding.UTF8. GetChars(memory Stream.GetBuffe r())
{Length=694}
[0]: 65279 ''
[1]: 60 '<'
[2]: 63 '?'
[3]: 120 'x'
[4]: 109 'm'
[5]: 108 'l'
....

I'm using the similar code found in this example ...

[http://www.dotnetjohn.com/articles.aspx?articleid=173]

.... so what's with this random UTF8 character [65279]? (Note 65279
equates to three question-marks in ASCII, I assume this is because
there is no corresponding character in the ASCII set and this character
takes up the space of three normal ASCII characters, but what is it?)

(b)

When I serialize my classes object the returning XML contains \"
[backslash + quotation-mark] rather than a simple quotation mark.
What's with that ... copying and pasting this into a blank .xml file
results in error when opening the document in Internet Explorer. It
just don't like it!

(c)

I was also looking into different methodologies of Serialization for my
class and resulted in an XML document containing \r\n which I'm
assuming has something to do with the formatting of the document. Do
you know what these are, what they're used for?

(2) Passing XML to SQLServer Stored Procedures

(a)
I can see that debugging the stored procedure on the database is going
to be a pain. I managed to clean the XML document created by the code
to replace \" with a single quote mark, but this is useless to me if
I want to debug a stored procedure that takes in XML, as I can't
write an Execute statement when the input variable contains several
single quotes? How do you go about debugging stored procedure that
takes in XML data?

(b)
I guess and overview of how to pass data between a c#.net application
to a SQL database system would be of great help. I'm recently new to
c# as well (coming from a VB background) which really doesn't help.
If you can help with any of the above then please drop me a line and
pass on that knowledge. The learning curse is kind of steep!

Regards,

Tim

P.S. I bow down to your otherwise superior knowledge and intellect!

Nov 30 '06 #1
1 1551
Caspian wrote:
When I serialize my class object(s) the returning XML contains a random
character(s) at the beginning of the document. Do you have any idea why
this may be occurring? I.e.

?Encoding.UTF8. GetChars(memory Stream.GetBuffe r())
{Length=694}
[0]: 65279 ''
Could be a byte order mark (BOM), see
<http://en.wikipedia.or g/wiki/Byte_Order_Mark >

When I serialize my classes object the returning XML contains \"
[backslash + quotation-mark] rather than a simple quotation mark.
What's with that ... copying and pasting this into a blank .xml file
results in error when opening the document in Internet Explorer. It
just don't like it!
Usually when people report this they are looking at strings in an IDE or
debuggger which tends to escape such characters. When the XML is saved
directly to a stream or file then the character is not escaped and the
XML is well-formed.


--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Nov 30 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1846
by: Ken Fine | last post by:
I would like some guidance regarding a "content scanner" I'm trying to build. This ASP widget will automatically scan remote web sites for certain kinds of content using a screen scraping component and simple pattern matching. The widget will generate reports about what it found and where. Ideally, I would like the widget to follow all of the http:// links on the remote page for one level, and scan the child pages for certain kinds of...
3
2604
by: Michael Crawford | last post by:
Hi, Where would one start for this type of application: I want to create an vb.net container application that has the gives the end user the ability to install and uninstall plugins or add-in modules. As the user installs the various components, additional functionality to the application is integrated. How would I structure or orchestrate a project plan that makes use of add-in
11
5288
by: Ken Durden | last post by:
I am in search of a comprehensive methodology of using these two object cleanup approaches to get rid of a number of bugs, unpleasantries, and cleanup-ordering issues we currently have in our 4-month old C#/MC++ .NET project project. I'd like to thank in advance anyone who takes the time to read and/or respond to this message. At a couple points, it may seem like a rant against C# / .NET, but we are pretty firmly stuck with this approach...
3
277
by: Michael Crawford | last post by:
Hi, Where would one start for this type of application: I want to create an vb.net container application that has the gives the end user the ability to install and uninstall plugins or add-in modules. As the user installs the various components, additional functionality to the application is integrated. How would I structure or orchestrate a project plan that makes use of add-in
0
8324
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8842
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
7352
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5642
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4173
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4330
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1970
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.