How can I write an XSD which doesn't care what the root element is called? -


my xml files have restrictions on child elements, doesn't matter name of root element is. how can incorporate xsd? i've tried using <xs:any> get:

"s4s-elt-invalid-content.1: content of 'schema' invalid. element 'any' invalid, misplaced, or occurs often."

so tried missing name off element tag this: <xs:element> get:

"s4s-att-must-appear: attribute 'name' must appear in element 'element'."

use named type, , tell validator start validation @ root element using type.

(there 1 possible hitch this: xsd 1.0 suggests 1 possible invocation option, not require validators provide it, there's no guarantee validator interface use support it. depends on validator. worth trying, @ least.)

another way put this: have asking for, because xsd schema never cares root element of document instance called. xsd schema provides set of element , type declarations (among other things). validator can requested start validation @ point in document, not root, , either element declaration or type declaration, or in 'lax wildcard mode' (the common default). if validator doesn't offer invocation options want, it's flaw in choice of validator, not gap in xsd.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -