Is there a way to filter if the XML containes hyphenated nodes?  I can
return a list of nodes, but I want to get a specific value.

given this xml
var phoneList = <table>
        <row>
                <COMPANY-NAME>DUNDER MIFFLIN</COMPANY-NAME>
                <EMPLOYEE-NAME>Jim Halpert</EMPLOYEE-NAME>
                <EMPLOYEE-PHONE>555-555-5555</EMPLOYEE-PHONE>
        </row>
        <row>
                <COMPANY-NAME>INNOTECH</COMPANY-NAME>
                <EMPLOYEE-NAME>Peter Gibbons</EMPLOYEE-NAME>
                <EMPLOYEE-PHONE>555-444-4444</EMPLOYEE-PHONE>
        </row>
        <row>
                <COMPANY-NAME>DUNDER MIFFLIN</COMPANY-NAME>
                <EMPLOYEE-NAME>Dwight Schroot</EMPLOYEE-NAME>
                <EMPLOYEE-PHONE>555-555-5550</EMPLOYEE-PHONE>
        </row>

</table>;

if I want to get only the DUNDER MIFFLIN records, I can't use
phoneList..row.(COMPANY-NAME == "DUNDER MIFFLIN")
because the hypen is used as a minus and I get an error about NAME not
being defined or something.

I know that I can get a list of all the "COMPANY-NAME" nodes using
phoneList..row["COMPANY-NAME"];
-or-
phoneList...row.descendants("COMPANY-NAME");

those both return:
<COMPANY-NAME>DUNDER MIFFLIN</COMPANY-NAME>
<COMPANY-NAME>INNOTECH</COMPANY-NAME>
<COMPANY-NAME>DUNDER MIFFLIN</COMPANY-NAME>

Is there a way to filter the list?  How can I just the DUNDER MIFFLIN
list? How can I do this?
phoneList..row.(COMPANY-NAME == "DUNDER MIFFLIN");





And to take it a step further. Just get the list of Dunder Mifflin
employees.  How
phoneList..row.(COMPANY-NAME == "DUNDER MIFFLIN").EMPLOYEE-NAME;

and ultimately the phone number for a specific employee at a specific
company.
phoneList2..row.(COMPANY-NAME == "DUNDER MIFFLIN" && EMPLOYEE-NAME ==
"Jim Halpert").EMPLOYEE-PHONE;
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino

Reply via email to