I have an XSD file including some patterns and need to create a bunch of XML documents for testing matching this schema. I know there are some tools and frameworks out there like xsd.exe, JAXB, etc. which create classes out of the XSD.
Basically I need to do the following steps:
- Load XSD
- Parse XSD
- Create matching XML document
Example:
<xs:simpleType name="typeName">
<xs:restriction base="xs:string">
<xs:pattern value="[A-ZÄÖÜß][A-ZÄÖÜß'/\-.+ ]*"/>
<xs:pattern value="+[ ]*"/>
</xs:restriction>
</xs:simpleType>
What would be a standard way doing this? The point is that all this shall happen at runtime, i.e. not creating classes via xsd.exe or else. Preferrably in C# or Java but any language is welcome.