The related question is the one I asked earlier ...
Just checking something: should the xmlns, xmlns: xsi and xsi: schemaLocation attributes order in the XML file?
I find this to happen - at least when using XML Notepad 2007 to view an XML file. For example (suppose my XML file is legal according to my schema), this does not give errors (example 1):
<myroot xmlns="http://www.someurl.com/ns/myroot" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someurl.com/ns/myroot http://www.someurl.com/xml/schemas/myschema.xsd"> <sometag>somecontent</sometag> </myroot>
but it does (example 2):
<myroot xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.someurl.com/ns/myroot http://www.someurl.com/xml/schemas/myschema.xsd" xmlns="http://www.someurl.com/ns/myroot"> <sometag>somecontent</sometag> </myroot>
(The error is that "sometag" is an illegal entry in accordance with the scheme).
My problem is that if I use the code from my other question to create my schema names and attributes, I get the XML attributes output as in example 2 ...
Should the xmlns attribute always be the first in the attribute list?
source share