Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / September 2007

Tip: Looking for answers? Try searching our database.

XML namespaces and XSD.exe

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Namshub - 26 Sep 2007 14:21 GMT
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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.