Any tools to generate an XSD schema from an XML instance document? [closed]

the Microsoft XSD inference tool is a good, free solution. Many XML editing tools, such as XmlSpy (mentioned by @Garth Gilmour) or OxygenXML Editor also have that feature. They’re rather expensive, though. BizTalk Server also has an XSD inferring tool as well. edit: I just discovered the .net XmlSchemaInference class, so if you’re using .net … Read more

What are XML namespaces for?

They’re for allowing multiple markup languages to be combined, without having to worry about conflicts of element and attribute names. For example, look at any bit of XSLT code, and then think what would happen if you didn’t use namespaces and were trying to write an XSLT where the output has to contain “template”, “for-each”, … Read more

What does elementFormDefault do in XSD?

ElementFormDefault has nothing to do with namespace of the types in the schema, it’s about the namespaces of the elements in XML documents which comply with the schema. Here’s the relevent section of the spec: Element Declaration Schema Component Property {target namespace} Representation If form is present and its ·actual value· is qualified, or if … Read more

xmlns, xmlns:xsi, xsi:schemaLocation, and targetNamespace?

Namespace related attributes in XML and XML Schema (XSD) xmlns is part of the W3C Namespaces in XML Recommendation: The prefix xmlns is used only to declare namespace bindings and is by definition bound to the namespace name http://www.w3.org/2000/xmlns/. In your example, it declares that http://maven.apache.org/POM/4.0.0 is the default namespace for the elements in your … Read more

XML Schema minOccurs / maxOccurs default values

The default values for minOccurs and maxOccurs are 1. Thus: <xsd:element minOccurs=”1″ name=”asdf”/> cardinality is [1-1] Note: if you specify only minOccurs attribute, it can’t be greater than 1, because the default value for maxOccurs is 1. <xsd:element minOccurs=”5″ maxOccurs=”2″ name=”asdf”/> invalid <xsd:element maxOccurs=”2″ name=”asdf”/> cardinality is [1-2] Note: if you specify only maxOccurs attribute, … Read more

What’s the difference between xsd:include and xsd:import?

The fundamental difference between include and import is that you must use import to refer to declarations or definitions that are in a different target namespace and you must use include to refer to declarations or definitions that are (or will be) in the same target namespace. Source: https://web.archive.org/web/20070804031046/http://xsd.stylusstudio.com/2002Jun/post08016.htm