How to fix error: The markup in the document following the root element must be well-formed

General case The markup in the document following the root element must be well-formed. This error indicates that your XML has markup following the root element. In order to be well-formed, XML must have exactly one root element, and there can be no further markup following the single root element. One root element example (GOOD) … Read more

Validating XML with XSDs … but still allow extensibility

Your issue has a resolution, but it will not be pretty. Here’s why: Violation of non-deterministic content models You’ve touched on the very soul of W3C XML Schema’s. What you are asking — variable order and variable unknown elements — violates the hardest, yet most basic principle of XSD’s, the rule of Non-Ambiguity, or, more … Read more

XML Schema Validation : Cannot find the declaration of element

Thanks to everyone above, but this is now fixed. For the benefit of others the most significant error was in aligning the three namespaces as suggested by Ian. For completeness, here is the corrected XML and XSD Here is the XML, with the typos corrected (sorry for any confusion caused by tardiness) <?xml version=”1.0″ encoding=”UTF-8″?> … Read more

What is the difference between xsd and xsi?

xsd and xsi Similarities Both are XML namespace prefixes, abbreviations for an XML namespace. Both are, as are all namespace prefixes, arbitrarily named; other namespace prefix abbreviations could equally well be used. However, both prefixes are conventional and therefore recommended. (An also-conventional alternative to xsd is xs.) xsd and xsi Differences The xsd (or xs) … Read more

XML validation with XSD: how to avoid caring about the sequence of the elements?

<xsd:complexType name=”questions”> <xsd:all> <xsd:element name=”location” type=”location”/> <xsd:element name=”multipleChoiceInput” type=”multipleChoiceInput”/> <xsd:element name=”textInput” type=”textInput”/> <xsd:element name=”pictureInput” type=”pictureInput”/> </xsd:all> </xsd:complexType> NOTE: I have changed “sequence” to “all” Sequence forces order (as defined). if order doesn’t matter then all is used. If there are chances of element occurence more than once then xsd:any can be used. <xsd:complexType name=”questions”> <xsd:sequence> … Read more

cvc-elt.1: Cannot find the declaration of element ‘MyElement’

Your schema is for its target namespace http://www.example.org/Test so it defines an element with name MyElement in that target namespace http://www.example.org/Test. Your instance document however has an element with name MyElement in no namespace. That is why the validating parser tells you it can’t find a declaration for that element, you haven’t provided a schema … 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

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)