Reputation: 349
In Clojure is there a simple way to generate some sample xml based on an xsd? And how would you pull out the xpaths from the xml? (This seems the kind of problem that Clojure is good at.)
For example - turn this:
<xsd:complexType name="USAddress">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="street" type="xsd:string"/>
<xsd:element name="city" type="xsd:string"/>
<xsd:element name="state" type="xsd:string"/>
<xsd:element name="zip" type="xsd:integer"/>
</xsd:sequence>
<xsd:attribute name="country" type="xsd:NMTOKEN" fixed="US"/>
</xsd:complexType>
</xsd:schema>
To this:
<?xml version="1.0" encoding="utf-8"?>
<PurchaseOrder OrderDate="2012-12-13">
<ShipTo country="US">
<name>str1234</name>
<street>str1234</street>
<city>str1234</city>
<state>str1234</state>
<zip>1234</zip>
</ShipTo>
<BillTo country="US">
<name>str1234</name>
<street>str1234</street>
<city>str1234</city>
<state>str1234</state>
<zip>1234</zip>
</BillTo>
</PurchaseOrder>
Upvotes: 1
Views: 845