May 19, 2009, 8:58 AM
[CLOSED] Advanced XML / JSON Reader
Hi all,
i'm developing a WebService that retrives me data from a database using custom WebMethods.
Now i want bind a ext:GridPanel with the data that a WebMethod retrives.
The main problem is that the XML that my WebService serialize is a little bit more complex than the classical xml styles i saw in the coolite examples explorer.
I post you an example saw here:
<A href="https://examples1.ext.net/#/GridPanel/Miscellaneous/Xml_File_Loading/">
https://examples1.ext.net/#/GridPane..._File_Loading/
</A>
As you can see the Plants.xml binded to the ext:GridPanel is not really so complex, in fact the xml structure is something like:
There is a way to map those fields on my XmlReader with something like this:
Please Help,
thanks in advice,
i'm developing a WebService that retrives me data from a database using custom WebMethods.
Now i want bind a ext:GridPanel with the data that a WebMethod retrives.
The main problem is that the XML that my WebService serialize is a little bit more complex than the classical xml styles i saw in the coolite examples explorer.
I post you an example saw here:
<A href="https://examples1.ext.net/#/GridPanel/Miscellaneous/Xml_File_Loading/">
https://examples1.ext.net/#/GridPane..._File_Loading/
</A>
As you can see the Plants.xml binded to the ext:GridPanel is not really so complex, in fact the xml structure is something like:
<catalog>
<plant>
<common>Bloodroot</common>
<botanical>Sanguinaria canadensis</botanical>
<zone>4</zone>
<colorCode>E7E7E7</colorCode>
<light>Mostly Shady</light>
<price>2.44</price>
<availability>03/15/2006</availability>
<indoor>true</indoor>
</plant>
<plant>
....
</plant>
</catalog>
But what if the Plants.xml structure would be something like<catalog>
<plant referenceKey="ADF63-A" price="2.44" colorCode="E7E7E7">
<availability>03/15/2006</availability>
<indoor>true</indoor>
<zoneList>
<zone>
<id>5</id>
<name>Europe</name>
<zone>
<zone>
<id>3</id>
<name>America</name>
<zone>
</zoneList>
</plant>
<plant>
....
</plant>
</catalog>
How could i bind my ext:GridPanel with this xml mapping the attributes and childs of my Plant element?There is a way to map those fields on my XmlReader with something like this:
<ext:Store runat="server" ID="Store1" AutoLoad="true">
<Proxy>
<ext:HttpProxy runat="server" Url="../../Shared/Plants.xml" />
</Proxy>
<Reader>
<ext:XmlReader Record="plant">
<Fields>
<ext:RecordField Name="plant.price" Type="Float" />
<ext:RecordField Name="plant.referenceKey" Type="String" />
<ext:RecordField Name="plant.zoneList.zone[0].name" Type="String" />
</Fields>
</ext:XmlReader>
</Reader>
</ext:Store>
I think this is impossibile to do but there's another way to do it with a XmlReader or JSON reader?Please Help,
thanks in advice,