i need to write a schema that all xml instances are valid to it.
i tried:
<xs:element name="Arguments">
<xs:complexType>
<xs:sequence>
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded" processContents="lax" />
</xs:sequence>
</xs:complexType>
but it enforces a root element named Arguments.
is there a way for the root to be Any ?
Good question, although I am not sure it can be done. Your approach with using
xs:anyis good but I’m not sure it can be applied for an entire XML (i.e. the root) but just for a section of it.To quote from a book I once read (something that puts a purpose on the “why?” people are asking): […] useful when writing schemas for languages such as XSLT that routinely include markup from multiple vocabularies that are unknown when the schema is written […] useful when you’re just beginning to design the document structure and you don’t yet have a clear picture of how everything fits together […] (XML in a nutshell)
I’m also curious to see if it can be done or what is the best workaround for this.