XML schema namespaces
I'm a beginner with xml and schemas. I'm going to be creating around 14 different xmls each with their own schemas (as I might have a few different people inputting information, want to make sure everything matche开发者_如何学Pythons when I pull the data into the c# program i'm writing)
I've read through a few tutorials, and I get that the namespaces should be unique (usually)URLs.Where I'm having issue (and some difficulty finding) is since, for now, none of this will be hosted on the web (the end program will come "packaged" with the xmls and xsds) does the namespace actually matter
more detail:
I'm using visual studios xml editor(because I'm a student, I got it for free, so I might as well use the damned thing)
It auto fills in some values with http://tempuri.org;<xs:schema targetNamespace="http://tempuri.org/XMLSchema.xsd"
elementFormDefault="qualified"
xmlns="http://tempuri.org/XMLSchema.xsd"
xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
My specific question is, should I change the tempuri's or can I just leave them for now (eventually the friend I'm writing the program for does want it to be hosted on a website, but that's a long ways off as he wants a windows gui program first).
If it's recommended to be changed, does it matter what it's changed to? (yeah I'm a bit confused as you can tell)
Thank you in advance for any help.
In order to take advantage of the schema while processing the employee element, the processor needs to locate the correct schema definition. How schema processors locate the schema definition for a particular namespace is not defined by the specification. Most processors, however, will allow you to load an in-memory cache of schemas that it will use while processing documents.
(source)
If you have another way to give your code that is processing the XML access to the schema in memory, your URL does not have to actually point to the location of the XSD. If, however, you cannot provide the schema in memory some other way the URL should point to a valid location of the XSD.
精彩评论