tdom : dealing with attributes
- From: chedderslam <chedderslam@xxxxxxxxx>
- Date: Fri, 30 May 2008 06:21:38 -0700 (PDT)
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.
.
- Follow-Ups:
- Re: tdom : dealing with attributes
- From: Gerald W. Lester
- Re: tdom : dealing with attributes
- Prev by Date: ofFDouvNJqohjBojyS
- Next by Date: Re: merging variables and arrays ... conflicting with cloverfield?
- Previous by thread: ofFDouvNJqohjBojyS
- Next by thread: Re: tdom : dealing with attributes
- Index(es):