That xmlns attribute specifies a "default namespace" and means that the root element and its children are in this namespace.What i misunderstood is that, there's no way with the DOM api to specify a "default namespace" for each children of the root element.Thus you may need to use create Element NS() and create Attribute NS() methods for each created element or attribute in the document specifying the URI of your namespace each time ("

validating xml against xsd net-75validating xml against xsd net-66

Welcome to the Coding Forums, the place to chat about anything related to programming and coding languages.

Please join our friendly community by clicking the button below - it only takes a few seconds and is totally free.

You'll be able to ask questions about coding or chat with the community and help others.

Old error message: Warning: DOMDocument::schema Validate() [function.schema Validate]: Element 'child_integer': 'Error condition.' is not a valid value of the atomic type 'xs:integer'.

A note for people trying to validate complex schemas with PHP.

It seems that libxml will not automatically try to import referenced schemas, but simply skip the validation if the schemas were not explicitly imported.

In our example we tried to validate an XML file against a schema with the namespace "xttp://automotive-his.de/200706/rif" that contains a reference to the namespace "xttp://automotive-his.de/200706/rif-xhtml": which basically says that an xhtml-content element can contain any element from the rif-xhtml namespace.

in on line 40New error message: DOMDocument::schema Validate() Generated Errors!

Error 1824: Element 'child_integer': 'Error condition.' is not a valid value of the atomic type 'xs:integer'.

in on line 4 I had a tricky issue using this method, i thought it was bug but i realized i misundestood something about namespaces.

When you want to use a schema to describe an xml document, you basically put the default namespace to a personnal namespace (and you refer to this namespace in the target Namespace attribute of your schema).