473,785 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't deserialize: throws exception "..error in XML document(2,2)"

I get an exception ...." There is an error in XML document(2,2)." on deserializing. Pls Help

<?xml version="1.0" encoding="utf-8" ?>
<PresetRecord xmlns=http://test>
<CameraAPipelin e type="key">
<PresetID type="dword">2</PresetID>
</CameraAPipeline >
</PresetRecord>
here's the class I am using:

public class PresetRecord {

public CameraAPipeline cameraAPipeline ;
public PresetRecord() {}
}
public class CameraAPipeline
{
[XmlAttribute]
public string type;
[XmlElement]
public PresetID presetID;
public CameraAPipeline () {}
}
public class PresetID
{
[XmlAttribute]
public string type;
[System.Xml.Seri alization.XmlTe xtAttribute()]
public string Text;
public PresetID() {}
}
..............
FileStream fs = new FileStream(file Path, FileMode.Open);
reader = new XmlTextReader(f s);
serializer = new XmlSerializer(t ypeof(PresetRec ord));
PresetRecord aRecord = new PresetRecord();
aRecord = (PresetRecord)s erializer.Deser ialize(reader);
............

Nov 12 '05 #1
0 5827

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

Similar topics

0
1416
by: JD | last post by:
While reading through the "shortcuts" topic in the help, I saw that there's a "Format Document" option - CTRL+K, CTRL+D. Cool... so I go into a .cs source file (this is a winforms project) and hit those keys. The status bar tells me "The key combination (Ctrl+k, Ctrl+D) is not a command." Weird... I then check the Edit menu->Advanced. Format Selection is there, but Format Document isn't. Ok, so I go into Customize... verify that the...
5
19044
by: theroo | last post by:
Hi there, I am driving myself crazy over this problem. I have used this very same function in another page without any problems, but now I am experiencing the "Error: Expected ';'" when i try and run it, and it doesn't fire (obviously, because there is an error). The code is:
1
1776
by: Tony | last post by:
I have my access database with a list of student's names, some student has the name as O'Neal.. when i am doing a search in my windows applicaiton sql queries, i couldn't search for it coz it will throw a syntax error exception (the sql is: SELECT * FROM tblStudent WHERE Name='O'Neal';) Since there is a quote in between the name, it throws a syntax error.. i was told by my friends that i can use three quotes to get around this but the...
1
1983
by: TD | last post by:
I'm using iText in an app to create and print documents to network printers. I launch acrobat via the command line as shown on this page... http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/intro_to_sdk/DeveloperFAQ.pdf Every once in a while, I get a generic "document failed to print" dialog from acrobat.
2
3189
by: Claus - Arcolutions | last post by:
I got a word document as a stream, and I want to get the text from the word document. But I cant seem to find anything to use for that purpose. The "Microsoft office ?.object" com reference, only include functionality to read from a file (as far as I know). I looked a little on the structure of the document, but it doesnt seem to have any common structures, especially not if you compare from different office versions.
9
1534
by: Ant | last post by:
Hi, I'm wondering if anybody can tell me what the Validate document button is used for & how to use it. When I deliberately put some tag in that shouldn't be there, (such as an extra body tag) & use this buton, nothing happens. Can anybody tell me what it's used for? Many thanks for your help Ant
3
1884
by: eight02645999 | last post by:
hi I need to execute sql command using a "here document" like in unix. os.popen("osql", "w").write("""\ select * from table go """) how can i pipe these result of the select into a variable?
21
7864
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
11
2040
by: kimiraikkonen | last post by:
Hello, I'm very new to C# and just installed VC# 2005 express edition and i have VB 2005 express installed previously. But i saw a thing which may be called as a "Visual C# 2005 express" bug? For example, in VB 2005 express while i was coding, if there's a coding error, errors are displayed in error list below the screen immediately during coding and before starting debugging. But in VC# 2005 express, if there's a coding error,...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9489
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
10162
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7509
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
6744
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
5396
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
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2893
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.