# XML Attributes vs. ? and Javascript

**URL:** <https://forum.kirupa.com/t/xml-attributes-vs-and-javascript/308661>\
**Category:** Uncategorized\
**Created:** [April 27, 2010, 10:58pm UTC](https://forum.kirupa.com/t/xml-attributes-vs-and-javascript/308661 "2010-04-27T22:58:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spyderfx](https://avatars.discourse-cdn.com/v4/letter/s/c2a13f/32.png) [@spyderfx](https://forum.kirupa.com/u/spyderfx)\
**Post date:** [April 27, 2010, 10:58pm UTC](https://forum.kirupa.com/t/xml-attributes-vs-and-javascript/308661/1 "2010-04-27T22:58:52Z")

</div>

I’m trying to consolidate two XML documents that have their information written out differently. In one all the info is an “attribute”.

```auto

<marker lat="38.663036" lng="-121.277524" address="5333 Primrose Drive" city="Fair Oaks" state="California" zip="95628" desc="2 Bed/2 Bath $975" url="http://www.bluerockpm.com/Primrose%20Drive.htm" />

```

In the other, I’m not sure what the technical term is for it, but it looks like this:

```auto

<property>
        <img>properties/Antelope/8345 Cereus Court/thumb.jpg</img>
        <area>Antelope</area>
        <address>8345 Cereus Court</address>
        <desc>3 Bed/2.5 Bath</desc>
        <price>1575</price>
        <url>http://www.bluerockpm.com/Cereus%20Court%208345.htm</url>
    </property>

```

How can I change my JavaScript so that it recognizes the second XML format instead of taking the attributes. The JS looks like this right now:

```auto

 var markers = xmlDoc.documentElement.getElementsByTagName("property");

var address = markers*.getAttribute("address");

```

Any help would be appreciated. Thank you!
