virtual4now
Programmer
I am sorry, I am very new to XML and have lost the help of someone who helped me write this code.
I have an XML file kinda like this:
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="sort.xsl"?>
<index>
<data section="controlled">
<rms docKey="414-060" subType="2" projNbr="b12414"/>
<rms docKey="414-060" subType="2" projNbr="b12414"/>
</data>
<data section="lastFive">
<rms docKey="414-060" subType="2" projNbr="b12414"/>
<rms docKey="414-060" subType="2" projNbr="b12414"/>
</data>
<data section="current">
<rms docKey="414-060" subType="2" projNbr="b12414"/>
<rms docKey="414-060" subType="2" projNbr="b12414"/>
</data>
</index>
This JavaScript code runs when the page loads:
// This is hardcoded, but the config file could be generated from a user's options
sOptions = "<?xml version=\"1.0\"?>"
sOptions += "<config>"
sOptions += "<select>rms</select>"
sOptions += "<filter>*</filter>"
sOptions += "<group>@projNbr</group>"
sOptions += "<sort>@docKey</sort>";
sOptions += "<sort>@subType</sort>";
sOptions += "</config>"
// now, let's transform the xml and display it
display('all',sOptions, "@projNbr");
I have more to the code obviously including the display function and the XSL file, but my question may be able to be answered without it.
What I am trying to do is select only one of the three "data section" and then process the "rms" elements within that.
Right now the code works, but works on all of the "rms" elements without any reguard to the sections they are in.
Any help or pointers would be wonderful.
Thanks!
Tim