The root element of the document can contain, along with all the xmlns
stuff, an attribute called
xsi:schemaLocation="namespaceURI filename.xsd"
There are two tokens inside the single string. This is a hint for the
validator to know where to find a physical xsd file to go with that
namespace.
--John
kaush - 05 Nov 2005 02:18 GMT
If I add it to the root element of the element for which I need to add
the xsi:schemaLocation attribute, it does not seem to be working.
Below is the partial XML doc:
<ProcessMessage
xmlns="http://www.starstandards.org/webservices/2003/12/transport">
<payload
xmlns="http://www.starstandards.org/webservices/2003/12/transport">
<Content id="Content0">
<rey_ServiceStatusRequest
xmlns="http://www.starstandards.org/STAR"> ...this goes on .
"rey_ServiceStatusRequest" parent is "Content"
I need to add the xsi:schemaLocation attribute to
"rey_ServiceStatusRequest" element. Actually this XML document I
produce it from a C# object. I use XMLSERIALIZE class to serialize the
object into XML document. For some reason I am not able to add the
xsi:schemaLocation attribute. I am able to add schemaLocation attribute
without the "xsi" prefix. I am able to do this using
//[System.Xml.Serialization.XmlAttributeAttribute(DataType="anyURI")].
This declaration is for a particular memeber of the class.
Could you please help me out ?
The only other option I have is to construct the XML doc "element" by
"element" which I do not want to do.
Please help