I don't know how to get the different parts of the xml into a string variable for the grids on the h

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
I know there will be a lot in this but I dont know how to get to my end point. This is my first project with xsl and I am starting from scratch with knowledge. I have learned a lot but am still having difficulty pulling this together. Our application now has a web browser object in it that will be used to display messages from a variety of sources. Each message will get transformed using an xsl. The message source that I am working on will be sending me data that contains some lists of elements such as people and in the same xml document I will get a list of cars. None of the people are associated with the cars , they are just lists. There will also be a node of general information that is not a list of elements. I want to display the people in a grid and the cars in a separate grid and the general information displayed in a logical flow. My thought is to use jqgrid for the grids and the data type would be xmlstring. I wanted to get the xml parts that I wanted,such as cars, and put them into a stringso that I can use the xmlreader for the jqgrid.
This requires something like the following in the javascript:

var carstring = "<cars><car><color>black</color><make>ford</make></car> ... </cars>"
datatype:"xmlstring"
datastr:carstring
I think my biggest problem is getting the data that I need into my document for each grid.

sample xml:

<mydoc>
<people>
<person><name>Sam</name><phone>1112223333</phone></person>
<person><name>Jon</name><phone>4442523113</phone></person>
<person><name>Mike</name><phone>1552228883</phone></person>
</people>
<cars>
<car><make>ford</make><color>black</color></car>
<car><make>Honda</make><color>blue</color></car>
</cars>
<Business><address>111 1st st</address><name>Stuff Store</name></Business>
<statistics><sales>200</sales><employees>3</employees></statisics>
<mydoc>

View the full article
 
Back
Top