There is no Unicode byte order mark. Cannot switch to Unicode

The reality of your file’s encoding appears to conflict with that specified by your XML declaration. If your file actually uses one-byte characters, declaring encoding=”utf-16″ won’t change it to use two-byte characters, for example. Try removing the conflicting encoding from the XML declaration. Replace <?xml version=”1.0″ encoding=”utf-16″?> with <?xml version=”1.0″?> You may also be able … Read more

targetNamespace and xmlns without prefix, what is the difference?

targetNamespace is an XML Schema “artifact”; its purpose: to indicate what particular XML namespace the schema file describes. xmlns – because the XML Schema is an XML document, it is then possible to define a default XML namespace for the XML file itself (this is what xmlns attribute does); the implications are multiple: authoring, and … Read more

Android schema validation

According to the documentation javax.xml.validation is supported since API level 8. (I will test that and report asap) Update Ok, the problem is not that simple: SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); failed on both level 8 and level 9 API with an IllegalArgumentException as described here Google doesn’t help on that matter except to find the … Read more

Parse Complex WSDL Parameter Information

This is not pretty – but it gets the job done (hopefully ;). I based this code partly on the link you provided, and then added some recursion to parse out the different types included in the schema, as well as the inner elements and their data types. This definitely does not take into account … Read more

Do you always have to have a root node with xml/xsd?

from the XML specification at http://www.w3.org/TR/REC-xml/ (fifth edition) chapter 2 This says “Each XML document has both a logical and a physical structure. Physically, the document is composed of units called entities. An entity may refer to other entities to cause their inclusion in the document. A document begins in a “root” or document entity.” … Read more

Tool that can combine many XSD files into one?

What you can do is to create another new file called file.xsd containing all the schema names in it and then the trick is to name the last schema file with .\ as prefix. File.xsd <xsd xmlns=”http://microsoft.com/dotnet/tools/xsd/”> <generateClasses language=”CS” namespace=”MyNamespace”> <schema>First.xsd</schema> <schema>Second.xsd</schema> <!– more schema files here –> <schema>.\Third.xsd</schema> </generateClasses> </xsd> Now run the command … Read more

How do I use PowerShell to Validate XML files against an XSD?

I want to comment that the script in current accepted answer doesn’t validate errors about incorrect orders of elements of xs:sequence. For example: test.xml <addresses xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance” xsi:noNamespaceSchemaLocation=’test.xsd’> <address> <street>Baker street 5</street> <name>Joe Tester</name> </address> </addresses> test.xsd <xs:schema xmlns:xs=”http://www.w3.org/2001/XMLSchema”> <xs:element name=”addresses”> <xs:complexType> <xs:sequence> <xs:element ref=”address” minOccurs=”1″ maxOccurs=”unbounded”/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name=”address”> <xs:complexType> <xs:sequence> <xs:element ref=”name” … Read more