Hi, I am very new to xml and xlst, I practiced small xml file and i converted but I am not able to iterate loops or something. My xml file look like this
Code:
<?xml version="1.0" encoding="UTF-8"?>
<orderinfo>
<data>
<service provider>raj</service provider>
<Customer>bvr</Customer>
<Suppliers>
<Supplier Id="svr" />
<Supplier Id="dvr" />
<Supplier Id="klr" />
</Suppliers>
</data>
<data>
<service provider>svr</service provider>
<Customer>raj</Customer>
<Suppliers>
<Supplier Id="avr" />
<Supplier Id="csr" />
<Supplier Id="ksr" />
</Suppliers>
</data>
<data>
<service provider>avr</service provider>
<Customer>svr</Customer>
<Suppliers>
<Supplier Id="Bpv" />
<Supplier Id="Wrr" />
<Supplier Id="Sdr" />
</Suppliers>
</data>
<data>
<service provider>csr</service provider>
<Customer>svr</Customer>
<Suppliers>
<Supplier Id="bvs" />
<Supplier Id="vvs" />
<Supplier Id="Ssv" />
</Suppliers>
</data>
<data>
<service provider>klr</service provider>
<Customer>PUMC</Customer>
<Suppliers>
<Supplier Id="ssn" />
<Supplier Id="qis" />
<Supplier Id="nan" />
</Suppliers>
</data>
</orderinfo>
in the above xml file represents customer and service information.
first I need to represent customer as node and service provider is another node and suppliers id are nodes and I need to edge all of them in the manner as shown below.for example first node in my xml data
Code:
bvr(customer)
raj(service provider)
svr(supplier) dvr(supplier) klr(supplier)
I need to connect edges from three supliers to raj and from raj to bvr. then coming to the next node in my xml data customer is "raj" so we have already node for "raj" then see service provider is "svr" so we have node for "svr" also then see service supplier we dont have nodes so create nodes and link between "svr" and his service suppliers. like that i need to do iterations and write graphML file for this xml file.
graphMl like this
Code:
<graph id="G" edgedefault="directed">
<node id="bvr">
</node>
<node id="raj">
</node>
<node id="svr">
</node>
<node id="dvr">
</node>
<node id="klr">
</node>
<edge source="raj" target="bvr">
</edge>
<edge source="svr" target="raj">
</edge>
<edge source="dvr" target="raj">
</edge>
<edge source="klr" target="raj">
</edge>
</graph>
help me with this problem.
Thanks in advance.