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("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


0
9/26/2007 1:21:51 PM
dotnet.xml 7266 articles. 0 followers. Follow

2 Replies
930 Views

Similar Articles

[PageSpeed] 43

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(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)> 

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

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
0
mahotrash (1777)
9/26/2007 3:26:31 PM
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" <mahotrash@yahoo.de> wrote in message 
news:eNVFpGFAIHA.4164@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(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)>
>
>                                                       ^^^^^^^^^
> you get "Unqualified". Are you sure you have actually run xsd.exe on that 
> XSD above?
>
> -- 
>
> Martin Honnen --- MVP XML
> http://JavaScript.FAQTs.com/ 


0
9/27/2007 8:06:59 AM
Reply:

Similar Artilces:

XML syntax as string
Hi I am trying to define string xml="<?xml version="1.0"?>"; But it gives error messages. Can any help me define <?xml version="1.0"?> as string... Thanks in advance Rahil string xml="<?xml version=\"1.0\"?>"; I hope it helps. >-----Original Message----- >Hi >I am trying to define >string xml="<?xml version="1.0"?>"; > >But it gives error messages. Can any help me define > ><?xml version="1.0"?> as string... > >Thanks in advance > >...

Displaying XML
There have been lots of posts on this topic, but I haven't been able to apply any of the suggestions to my situation. I have an .aspx page with a form on it that has several submit buttons on it. Clicking a button will cause a web service action that returns XML. I would like to display this XML response on the page with the form. I know I can display XML in an IFRAME by pointing its source to an XML file. But I'm streaming the XML dynamically. I also saw a suggestion to have the IFRAME's src point to the aspx page that loads the XML. Again, that won't work because I'...

xsl Cannot Pull data from XML sile
Hello I have a very simple xml file: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="./status.xsl"?> <IEC> <Workstation> <Hostname>HOSTNAME</Hostname> <CurrentPkg>PKGNAME</CurrentPkg> <TimeRunning>15 min</TimeRunning> <LastPkg>LastPKGNAME</LastPkg> <PercentComplete>95%</PercentComplete> </Workstation> </IEC> This file is built from information gathered about the workstation during...

Send datatable via XML
I have a VB application that I use to export data to the client's hard drive so they can import it into MSAccess. I can read the data into the datatable. How do I send a datatable via XML? I can send a dataset via XML but depending on the generated Select statement some columns are not included because there are no values. I need to include all columns and I think a datatable will do the trick. Any help will be appreciated. jd ...

A good book about XML Schema
Hi! Please can someone suggest me a good book to understand XML Schema? Thanks in advance. Fede These are a little old, but they have excellent coverage of XML, XSL, schemas, and the thinking that went behind the laying of foundations for these technologies and how they were intended to be used. Almost all of the concepts are still in use today. Microsoft Press Developing Xml Solutions: Programming for The Business Internet with Microsoft Windows DNA by Jake Sturm Sybex The XML Developer's Handbook by Kurt Kagle. Both books don't add any fluff to their content, and they come ...

SelectNodes and Two XMLNS's in XML Root
Hi, This is a newbie question to XMLNS. I just finished the article on "XML Namespaces and How They Affect XPath and XSLT" by Dare Obasanjo and I'm pretty sure I understand the problem. I just don't know how to achieve the desired XPath result. I'm dealing with an XML document that has two XMLNS' in the root node (Report) and I'm ending up with 0 results using SelectNodes. If I take out both namespaces, the SelectNodes(XPathQuery) works fine. With the XMLNS' the SelectNodes(XPathQuery, nsMgr) retrieves nothing. Here's a piece of the XML doc and wha...

Validating in-memory XML against in-memory DTD?
Hi I need to validate an in-memory XML document against an in-memory DTD. I've tried using XmlValidatingReader and it works but the compiler complains that the class is obsolete. Here's the code: string dtd = "<!ELEMENT bookstore (book)*> " + "<!ELEMENT book (title,author*,price)>" + "<!ATTLIST book genre CDATA #REQUIRED>" + "<!ELEMENT title (#PCDATA)>" + "<!ELEMENT author (name | (first-name,last-name...

OUTLOOK.EXE
I am using Outlook 2003 and get the following message when I send a message: OUTLOOK.EXE - NO DISK - No disk in drive - Pleas insert disk into drive\device\harddisk1\DR1. Is there a fix for this problem? Thanks. -- Ken Leffler <kmleffler@comcast.net> ...

WMS Idle: OUTLOOK.EXE-Unable To Locate Component.
I just migrate Outlook 2002 from POP to Exchange. After that, i alwayse get following error message when i launch Outlook 2002. "WMS Idle: OUTLOOK.EXE-Unable To Locate Component. This application has failed to start because OUTEX.DLL was not found. Re-install the application may fix this problem." I click OK, email box opens like normal. Anybody knows what cause this error and how to fix it. Thanks a lot!!! ...

setting default namespace ??
How can I set the default namespace of an XmlDocument/XmlElement? I've tried doing something like rootElement.SetAttribute( "xmlns", "http://www.w3.org/2000/xmlns/", "http://www.some.org/theschema" ); on the DocumentElement. However, this fails. Any ideas?? Thanks. Joost JoostV wrote: > How can I set the default namespace of an XmlDocument/XmlElement? You cannot set namespace of document in memory. You can add namespace declaration (by just adding as attribute), but it'll be in effect only when document is reparsed again. Instead try to accom...

Corrupted Money 2005 deluxe files and salv.exe will not work
Have had Money programs for about 10 years. Last Wednesday, I was no longer able to access the internet (Money was still functional). Took it to a computer service who had to restore the XP operating system (apparently spyware, $70/yr to Norton and Webroot well freakin spent). Charged me $295 bucks. Bring it home and the desktop looks like it did when I bought it. Here is what I did. 1. Installed the Money 2005 standard (which came with computer) . Then tried to open my data file. Got the error message saying the file is corrupted or not a Money data file. 2. Realized that I received...

Conditional Formatting on an XML list
Hi folks Another Excel newbie requiring assistance with conditional formatting, I'm afraid. My problem: I've been tasked by my employer to create a Spreadsheet in MS Excel 2003 for the purpose of displaying an XML *list* which is output from one of our legacy 3GL systems. I've created the spreadsheet using the map genetrated automatically by Excel, based on the actual XML file to be imported, and I can import the data at will. No problem there (I've set the import function to overwrite all previously stored data on selecting the 'refresh all' option on the import to...

Embedded XML datatsource for dependent ddl's
I need to put some embedded xml within a web page. It has to be in the webpage. Is their a way I could use this xml as a datasource for an extended Ajax cascading dropdown and not have postbacks (preferred) or just for some cascading DDLs. dropdownlist one: CarManufactures dropdownlist two: Models I've used ajax cascading dropdowns and xml. However,I have no clue on how to grab the xml from withing the webpage, filter it, and use it as a datasource for the dropdownlists. Chuck P wrote: > I need to put some embedded xml within a web page. It has to be in the > webpage. ...

Validating a string is in Xml format without doing a try{ XmlDocument.Load(.......
The title says it all. Is there a speed efficient way of validating that a string contains valid Xml without the overhead of try catch around a load attempt? Thanks in advance. Paul wrote: > Is there a speed efficient way of validating that a string contains > valid Xml without > the overhead of try catch around a load attempt? Reading your string with markup through an XmlReader (over a StringReader) checks for well-formedness, if you want to validate too you need to use XmlReaderSettings and set up the schemas first. There is no need to use XmlDocument, you only need that i...

convert sql tables with parent-child keys of a nested structure into a nested xml file
I have 5 tables in SQL Server. Each with the following design and a sample chain of the relationships from the root (WRL - World) UUS is the 'Code' of the first table and it is the 'Parent' value of the second table, etc. Parent varchar 3 Name varchar 60 Code varchar 3 WRL United States UUS <- UUS California UCA <- UCA North Coast UNC <- UNC Sonoma County USO <- USO Russian River Valley URR If I have 6 tables with these relationships from root to these vineyard appellation locations, how could I convert this nested, hiearchical data from SQL Server tables into...

System.Array to XML #2
Hi.. Is there a way to convert a System.Array to XML... If you know thanks very much... if you don't... Please do not respond stupid things like " Yes -- many ways." I suspect that you have got many stupid responses like that in the past, perhaps that is because it is not a great question. Your intentions are not clear. To take your question literally, the simple answer is no. The is no TypeConverter or built in cast for converting from System.Array to XML. So now that we have established that your question is stupid, lets get on with solving your problem. The following inf...

xml with inline xsl schema validation fails
Hi, I have an xml file with inline xsl when i try to validate with the schema it is throuing lot of errors is there any way to do this if i remove xsl and validate, it is woring fine Thanks madhumadala@gmail.com wrote: > I have an xml file with inline xsl when i try to validate with the > schema it is throuing lot of errors So you have one XML document which contains an XSLT stylesheet inline and you have an XSD schema document? Does the schema allow for the inline stylesheet? -- Martin Honnen --- MVP XML http://JavaScript.FAQTs.com/ ...

Read schema (xsd) to generate database
I'm trying to read an xsd into a DataSet to generate the SQL db that I will import the data into. I get a couple errors (one of which make sense) but am not sure how to work around them I'm using XmlDataDocument.DataSet.ReadXmlSchema() to try to read the schema at http://www.ordnancesurvey.co.uk/oswebsite/xml/schema/v3/OSDNFFeatures.xs I get an error stating 'System.ArgumentException: The same table (boundedBy) cannot be the child table in two nested relations.' This makes sense, I understand this is a limit of the DataSet trying to convert from xml to relational and gettin...

Export to XML???
Hi, Im running Outlook 2003 and I was wondering if anyone know if there is any way to turn a pst-file into XML? I have tried exporting to *.mdb first and then to XML from MS Access. However when exporting to *.mdb from Outlook one of the most important fields is missing: the datetime when the mail was sent/received! Does MS have any nifty app to do the conversion PST->XML with all the imporant fields or is there any third-party (free?) app who can do this? /Andreas Zita Andreas Zita <andzi460@student.liu.se> wrote: > Hi, Im running Outlook 2003 and I was wondering if anyone ...

Serialize CollectionBase derived List to XML file
Hi, I have a list which is derived from CollectionBase, and it contains a list of User objects, which I want to Serialize out to an XML file. Is there anywhere where I can find how to decode it so that it recognizes what objects are held in my list? or an example in C# prefereably? Many thanks in advance... Colin Colin, You can use the XmlSerializer class. Take note of this (from the help file): "The XmlSerializer gives special treatment to classes that implement IEnumerable or ICollection. A class that implements IEnumerable must implement a public Add method that takes a singl...

XSD.EXE, schemas and classes with collections of objects
I'm investigating using schemas to create classes for a project I'm working on. For simple classes, this works well (except for making all the instance var's public). However, the class I want to make has among its members a collection of objects. I have done some research, but I can't figure out how to (if it's possible) represent a collection of objects in an XSD. Is it possible? How is it done? Hi William, For example: MenuObject contains a collection of PizzaObjects. You have to define a complex type PizzaObjects that has one element of type PizzaObject wi...

Comparing two XML files in C#
Hallo everybody, I have the following problem. There are two XML files: first one (FIRST.xml) includes all products definition, the second one (SECOND.xml) is a product instance. What do I need is to compare these two files. Let's see an example: FIRST.xml <Product ID=""> <Element ID=""/> <Element ID=""/> ..... <Element ID=""/> </Product> SECOND.xml <Root> <Products> <Product ID=""> <Module Name=""/> <Module Name="...

Need help change a particular word in an XML doc
Hello, I have an XML doc and I am trying to write a utility thath will allow me to change a particular word with my "title" section of theXML doc. I would like to look for a "word" in the title and then change only that "word" to something else. Below in XML file I would want to change "Issue" to "Concern". This is one snip of the XML file there may be many more instances of the word "Issue" that I would want to change. I know how to walk through the file and find the whole instance of a string, ie Add/Raise Issue and then repla...

How to format two repeating XML elements w/o getting list of list
How do I set up an export spreadsheet with two repeating elements without getting the error "List of lists"? If I have a repeating node that also has repeating children I get errors no matter how I create the sheet! I can get this to work with ONE repeating element but then the XML gets very verbose with repetitious node names. Any help would be greatly appreciated ...

Outlook 2000
When I attempt to open OUTLOOK from the desk top icon, I receive an error message stating: "outlook.exe has generated errors. Does anyone have a correction for this problem or solution. PS - I also receive this error when I attempt to open outlook from: "start/programs. Thanks Can you get any more details about the error? "Breck" <Npba900@aol.com> wrote in message news:022e01c3674a$b2fc35e0$a401280a@phx.gbl... > When I attempt to open OUTLOOK from the desk top icon, I > receive an error message stating: > > "outlook.exe has generated errors. ...