Oh boy i'm getting tangled in knots here.
I have a schema which contains
<xs:schema
targetNamespace="http://Southend.Schemas.PAS/PASPatientDemographics.xsd"
id="PASPatientDetails"
xmlns:sh="http://Southend.Schemas.PAS/PASPatientDemographics.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
now i used the xsd.exe and it now generates elements when I serilaize the
class I get
<RequestingPatient_ID xmlns="">D1234567890</RequestingPatient_ID>
So each emlement contains xmlns="", why is this i just wanted a namespace
to identify the schema, and then all elements / records are part of that
namespace. so i really just want to render
<RequestingPatient_ID>D1234567890</RequestingPatient_ID>
IS this due to some feature in the xsdclass that is rendered.
<System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.42"), _
System.SerializableAttribute(), _
System.Diagnostics.DebuggerStepThroughAttribute(), _
System.ComponentModel.DesignerCategoryAttribute("code"), _
System.Xml.Serialization.XmlTypeAttribute(AnonymousType:=true), _
System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://Southend.Schemas.PAS/PASPatientDemographics.xsd",
IsNullable:=false)>
<System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
_
Public Property RequestingPatient_ID() As String
Get
Return Me.requestingPatient_IDField
End Get
Set
Me.requestingPatient_IDField = value
End Set
End Property
I hope someone can help with this issue.
Thanks
Martin Honnen - 26 Sep 2007 16:26 GMT
> I have a schema which contains
> <xs:schema
> targetNamespace="http://Southend.Schemas.PAS/PASPatientDemographics.xsd"
> id="PASPatientDetails"
> xmlns:sh="http://Southend.Schemas.PAS/PASPatientDemographics.xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
^^^^^^^^^^^^^^^^^^^^^^^^^^
That says qualified so I don't understand why below
> now i used the xsd.exe and it now generates elements when I serilaize the
> class I get
[quoted text clipped - 23 lines]
>
> <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)>
^^^^^^^^^
you get "Unqualified". Are you sure you have actually run xsd.exe on
that XSD above?

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Namshub - 27 Sep 2007 09:06 GMT
oh yes i'd never try to build he class by hand.
So I went back and looked over everything, and noticed that my class file
was not being updated properly when added to the project.. I also now
understand a little further what the qualified attributed will do to the
generation of the class.
You are a star! Thanks for the help
>> I have a schema which contains
>> <xs:schema
[quoted text clipped - 37 lines]
> you get "Unqualified". Are you sure you have actually run xsd.exe on that
> XSD above?