Note that there are some explanatory texts on larger screens.

plurals
  1. POCreate Xpath from XSD in Java
    primarykey
    data
    text
    <p>I am using Apache XMLSchema framework to parse and get the elements of an XSD. Now I need to associate a XPath string with each of those elements. Can some one give any Idea on how can I do this. Any existing algorithm or framework that does it?</p> <p>Example:</p> <pre><code>&lt;?xml version="1.0" encoding="ISO-8859-1" ?&gt; &lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt; &lt;xs:simpleType name="stringtype"&gt; &lt;xs:restriction base="xs:string"/&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="inttype"&gt; &lt;xs:restriction base="xs:positiveInteger"/&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="dectype"&gt; &lt;xs:restriction base="xs:decimal"/&gt; &lt;/xs:simpleType&gt; &lt;xs:simpleType name="orderidtype"&gt; &lt;xs:restriction base="xs:string"&gt; &lt;xs:pattern value="[0-9]{6}"/&gt; &lt;/xs:restriction&gt; &lt;/xs:simpleType&gt; &lt;xs:complexType name="shiptotype"&gt; &lt;xs:sequence&gt; &lt;xs:element name="name" type="stringtype"/&gt; &lt;xs:element name="address" type="stringtype"/&gt; &lt;xs:element name="city" type="stringtype"/&gt; &lt;xs:element name="country" type="stringtype"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;xs:complexType name="itemtype"&gt; &lt;xs:sequence&gt; &lt;xs:element name="title" type="stringtype"/&gt; &lt;xs:element name="note" type="stringtype" minOccurs="0"/&gt; &lt;xs:element name="quantity" type="inttype"/&gt; &lt;xs:element name="price" type="dectype"/&gt; &lt;/xs:sequence&gt; &lt;/xs:complexType&gt; &lt;xs:complexType name="shipordertype"&gt; &lt;xs:sequence&gt; &lt;xs:element name="orderperson" type="stringtype"/&gt; &lt;xs:element name="shipto" type="shiptotype"/&gt; &lt;xs:element name="item" maxOccurs="unbounded" type="itemtype"/&gt; &lt;/xs:sequence&gt; &lt;xs:attribute name="orderid" type="orderidtype" use="required"/&gt; &lt;/xs:complexType&gt; &lt;xs:element name="shiporder" type="shipordertype"/&gt; &lt;/xs:schema&gt; </code></pre> <p>XPath for</p> <pre><code>orderperson-&gt; ./orderperson name-&gt; ./shipto/name etc </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload