|
|
I am writing a simple xml to json converter. I have it working for a
basic xml document like this one:
<recordset>
<division>
<coe_division_name>mississippi valley</coe_division_name>
<division_abbreviation>mvd</division_abbreviation>
</division>
</recordset>
I am now trying to expand its capabilities to handle attribute values,
for documents like this:
<recordset>
<division ATTRIBUTE="ATTRIBUTE VALUE">
<coe_division_name>mississippi valley</coe_division_name>
<division_abbreviation>mvd</division_abbreviation>
</division>
</recordset>
Looking through the document at http://www.tdom.org/domNode.html, it
doesn't look like there is way way to test for the presence of
attributes. There is the method "hasAttribute", but it takes the name
of the attribute as an argument so it doesn't do what I am looking
for.
How would I test for the presence of attribute values and then access
them?
Thank you.
|
|