473,396 Members | 1,914 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,396 software developers and data experts.

XML namespaces and XSD.exe

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("x sd", "2.0.50727.42"), _

System.SerializableAttribute(), _

System.Diagnostics.DebuggerStepThroughAttribute(), _

System.ComponentModel.DesignerCategoryAttribute("c ode"), _

System.Xml.Serialization.XmlTypeAttribute(Anonymou sType:=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
Sep 26 '07 #1
2 4554
Namshub wrote:
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

<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("x sd", "2.0.50727.42"), _

System.SerializableAttribute(), _

System.Diagnostics.DebuggerStepThroughAttribute(), _

System.ComponentModel.DesignerCategoryAttribute("c ode"), _

System.Xml.Serialization.XmlTypeAttribute(Anonymou sType:=true), _

System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://Southend.Schemas.PAS/PASPatientDemographics.xsd",
IsNullable:=false)>

<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?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Sep 26 '07 #2
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

"Martin Honnen" <ma*******@yahoo.dewrote in message
news:eN**************@TK2MSFTNGP06.phx.gbl...
Namshub wrote:
>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

<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(Anonymo usType:=true), _

System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://Southend.Schemas.PAS/PASPatientDemographics.xsd",
IsNullable:=false)>

<System.Xml.Serialization.XmlElementAttribute(For m:=System.Xml.Schema.XmlSchemaForm.Unqualified)>

^^^^^^^^^
you get "Unqualified". Are you sure you have actually run xsd.exe on that
XSD above?

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/

Sep 27 '07 #3

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

Similar topics

18
by: Steven Bethard | last post by:
In the "empty classes as c structs?" thread, we've been talking in some detail about my proposed "generic objects" PEP. Based on a number of suggestions, I'm thinking more and more that instead of...
24
by: Marcin Vorbrodt | last post by:
Here is an example of my code: //Header file #include <vector> using std::vector; namespace Revelation { // class definitions, etc... // class members are of type std::vector }
2
by: Mike Morse | last post by:
What see sample that show xs:element where the xs namespace = http://www.w3.org/2001/XMLSchema However, I see another example with xsi: where xsi = http://www.w3.org/2001/XMLSchema-instance ...
3
by: Jim Heavey | last post by:
Trying to get the hang of Namespaces. I have primarly developed in VB and am transitioning to C# and the .Net Environment. I have worked a bit with Java as well in school about a year or so ago....
17
by: clintonG | last post by:
Using 2.0 with Master Pages and a GlobalBaseClass for the content pages. I understand the easy part -- the hierarchical structure of a namespace naming convention -- but the 2.0 IDE does not...
11
by: Random | last post by:
I'm confused about the proper use and usefulness of namespaces. I beleive I understand the purpose is so the developer can put classes within namespaces to essentially organize your code. And I...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.