473,324 Members | 2,179 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,324 software developers and data experts.

XSD for serialized object.


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 namespace entries.
<Attachment
d4p1:AttachmentId="297451"
d4p1:IsConfidential="false"
d4p1:FileSizeBytes="375412"
d4p1:UploadedWhen="2005-06-21T09:34:36.6549168+01:00"
d4p1:UploadedByUserId="CJH"
xmlns:d4p1="http://www.research-councils.ac.uk/ns/eps/nonschema/"
xmlns="http://www.research-councils.ac.uk/ns/common/">
<Filename>FileName.pdf</Filename>
</Attachment>

The attachment class has the following header..
<Serializable(),
System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://www.research-councils.ac.uk/ns/common/")> _
The properties that end up with d4p1 namespace are tagged like so..
<Xml.Serialization.XmlAttribute([Namespace]:="http://www.research-councils.ac.uk/ns/eps/nonschema/")> _
Public Property AttachmentId() As Integer
Get
Return Me._AttachmentId
End Get
Set(ByVal Value As Integer)
Me._AttachmentId = Value
End Set
End Property
So I'm a bit confused as to what generates that namespace prefix(sometimes
it appears as a d2p1, sometimes a d1p1), but more importantly how to bring
that into an XSD??

Any suggestions???


Nov 12 '05 #1
1 1674
Hello!
So I'm a bit confused as to what generates that namespace prefix(sometimes
it appears as a d2p1, sometimes a d1p1),
It's the XmlWriter that generates the prefixes, but you usually don't
have to care about them, in
<xml xmlns:a="foo" xmlns:b="foo">
<a:x /><b:x />
<x xmlns="foo" />
<c:x xmlns:c="foo" />
</xml>
Only the xmlns counts, not the prefix, the x-Elements are in the same
Namespace.

but more importantly how to bring
that into an XSD??

Any suggestions???


Create an XSD for each Namespace you use, import the namespaces into the
other schemas and use references (like <attribute
ref="ns2:FileSizeBytes" />)
--
Pascal Schmitt
Nov 12 '05 #2

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

Similar topics

2
by: Russ | last post by:
Hi, What's the easiest way of modifying an object which has been serialized to a DB? The previous developer created a complex object hierarchy and binary serialized the whole thing to a single...
2
by: andrew lowe | last post by:
Hi, Please bear with me on this problem, first I'll give you some background: I have an object that contains a DateTime field which i pass to a webservice public class Foo { public DateTime...
0
by: Ray Mitchell | last post by:
Hello, The result of auto-converting some Java code to C# yielded the following upgrade issue regarding the original Java call to "reset()": public virtual void writeObj(Object obj) {...
0
by: Wim Hollebrandse | last post by:
Here's the scenario. I'm serializing a particular object, which contains other objects as properties. I have this particular enum type that won't get included in the serialized XML. For...
0
by: Pierre | last post by:
Hi, I'm trying to select specific nodes from a XmlDocument filled with a serialized object and to insert these nodes into another XmlDocument. The object is well serialized (see below). From a...
2
by: Dennis C. Drumm | last post by:
Is there a way to open files with .net 1.1 versions of my software product that were serialized with a .net 2.0 version of same product? Right now, as soon as my older .net 1.1 application tries to...
5
by: EqDev | last post by:
I have a class that is a control derived from UserControl. I want to use serialization and deserialization with this calss but I get an exception "Cannot serialize member...
3
by: MMiGG | last post by:
Hi Our project need parse JAVA serialized object string in C, has any library? Thanx
1
by: Phil Galey | last post by:
I'm using XMLSerializer in VB.NET to serialize class-based objects to XML. It's serializing fine, except that I don't seem to have control over the order in which the various fields (properties) of...
0
by: bharathreddy | last post by:
Before going to that i want to say few thing on serialization : Serialization is the process of converting an object into a form that can be readily transported. For example, you can serialize an...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.