Hello everyone,
I want to do XML validation to validate whether an input XML file conforming to a schema file (.xsd). My question is when do we need to specify the target namespace parameter and what is the function of the target namespace parameter?
I got this question from the following MSDN pages,
http://msdn.microsoft.com/en-us/library/1hh8b082.aspx
http://msdn.microsoft.com/en-us/library/system.xml.schema.xmlschemaset.aspx
More specifically, I am referring to the 1st parameter of Add method of XmlSchemaSet class.
thanks in advance, George
EDIT1: My current confusion is,
- In the XML schema file, there is a target namespace attribute at top, and all elements defined in this XML schema file are defined in the target namespace;
- In the XML document file to check against scheme, the XML document may use elements defined in the "target namespace" of the XML schema file, and may also use elements from other namespaces other than the "target namespace" defined in the XML schema file;
- Question is, should we just add the "target namespace" to the Add method of XmlSchemaSet class, or add all namespaces which the XML document will use to the Add method of XmlSchemaSet class?
- Another question is, whether we could define multiple "target namespace" in the XML schema file? If yes, how?