473,387 Members | 1,542 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Serialized XML does not validate against the XSD

1
Hi there,

I am using the xsd.exe tool on a set of XSD files to generate object classes. When I later serialize the object classes to XML, the XML is not valid when validating against the XSD.

One of the generated classes has the following property:

[System.Xml.Serialization.XmlElementAttribute("Add" , typeof(Child[]))]
[System.Xml.Serialization.XmlElementAttribute("Dele te", typeof(long[]))]
public object Item
{
get
{
return this.childField;
}
set
{
this.childField = value;
}
}


When Xml-serializing the object the resulting XML is something like this:

...
<Add>
<Child>
(the Child data as XML)
</Child>
<Child>
(the Child data as XML)
</Child>
</Add>

or...

<Delete>
<long>
(a number)
</long>
<long>
(a number)
</long>
</Delete>

The schema expect the <Child> and <long> elements to be named <Data>

The XSD-files are provided by the customer and therefore cannot be changed, so I planned to override the serialization using XmlAttributeOverrides. I just can't figure out, how to setup the override to make it happend.

Any help is greatly appreciated!

-muhlig
Jun 26 '07 #1
0 855

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: QuantDev | last post by:
Hi NG, I would need to validate an XML fragment against a type defined within an XSD (which defines many other things). What is the correct way of achieving this? QD2004
1
by: aevans1108 | last post by:
Greetings All If this is the wrong place to post this question, please give me a push in the right direction. Thanks. I know there has to be a simpler way to do this, but this is as simple a...
1
by: Craig | last post by:
Anyone have any snippets of creating an XSD that I could validate a serialized object against. Specifically my problem comes from the the following serialized xml which contains some d4p1...
7
by: Ali-R | last post by:
Hi all, I am getting a CSV file like this from our client: "C1","2","12344","Mr","John","Chan","05/07/1976"......... I need to validate **each filed value** against a set of rules ,for...
4
by: Mr. x | last post by:
Hello, I know about the validator on : http://validator.w3.org , which can validate html pages. I just new to this validator. How can I validate (if it can be - by this validator) aspx pages,...
2
by: John H | last post by:
Hi, How can i just use the XmlDocument object to validate an xml instanace against a schema referenced inside the xml instance? The Load method seems to not validate it against the schema. ...
1
by: jman | last post by:
Is there anyway to write a VERY generic schema for the xml recieved when you serialize a DataSet? I know that the serialization includes a copy of the specific schema used by the dataset. I will...
1
by: engwar | last post by:
The title says it all. How do I use XMLDocument.Validate() against a DTD. In all my Googling about this I only find examples of how to validate an XMLReader or XmlValidatingReader against a DTD....
1
by: Joris van Lier | last post by:
Hi, im trying to validate objects before they are sent over the wire to a webservice, the schema embedded into WSDL is not sufficient so i took that schema and extended it with additional...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
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...

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.