# Something to convert in XML?

**URL:** https://discourse.nodered.org/t/something-to-convert-in-xml/8478
**Category:** General
**Created:** [28 February 2019 14:52 UTC](https://discourse.nodered.org/t/something-to-convert-in-xml/8478 "2019-02-28T14:52:06Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jycemea](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jycemea](https://discourse.nodered.org/u/jycemea)
#### Post date: [28 February 2019 14:52 UTC](https://discourse.nodered.org/t/something-to-convert-in-xml/8478/1 "2019-02-28T14:52:06Z")

</div>

I'm facing a problem now. I need to convert some datas (in function node) in XML to connect an API... but the current XML syntax is not accepted in Node Red function Node:

For example my object is named : WifiAccessPoints  
But on the other side, the API is waiting for : access-point

What is the right solution to rename **WifiAccessPoints** in **access-point** without errors in my function node?

Thanks...

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [28 February 2019 14:55 UTC](https://discourse.nodered.org/t/something-to-convert-in-xml/8478/2 "2019-02-28T14:55:51Z")

</div>

This page might be of use [https://www.w3schools.com/js/js\_object\_properties.asp](https://www.w3schools.com/js/js_object_properties.asp)

---

<div class="post-metadata">

### Author: ![jycemea](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jycemea](https://discourse.nodered.org/u/jycemea)
#### Post date: [28 February 2019 15:08 UTC](https://discourse.nodered.org/t/something-to-convert-in-xml/8478/3 "2019-02-28T15:08:54Z")

</div>

Thanks... but I did not see any relative answer... as here, the problem is to write a composed name with a **-** in the middle, which I don't know how it is supported in my function node or in javascript (I don't know javascript)...

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [28 February 2019 15:10 UTC](https://discourse.nodered.org/t/something-to-convert-in-xml/8478/4 "2019-02-28T15:10:23Z")

</div>

use key notation eg

`objectName["property"] // person["age"]`

---

<div class="post-metadata">

### Author: ![jycemea](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jycemea](https://discourse.nodered.org/u/jycemea)
#### Post date: [28 February 2019 15:42 UTC](https://discourse.nodered.org/t/something-to-convert-in-xml/8478/5 "2019-02-28T15:42:42Z")

</div>

I'm sorry but I still can't see where is the relation....

Can someone please explain me how to replace **wifiAccessPoints** with **access-point** in **answer.wifiAccessPoints** and in **answer.wifiAccessPoints.push** , in the code below??

```auto
let i;
answer.wifiAccessPoints = []
    if (answer.flag === "V") {
        let wifiAccessPointsStrings = elements[5].split("&")
        let j;
        for (j = 0; j < wifiAccessPointsStrings.length; j++) {
            let baseElements = wifiAccessPointsStrings[j].split("|")
            answer.wifiAccessPoints.push({ ssid: baseElements[0], macAddress: baseElements[1], signalStrength: baseElements[2] })  
    }
      answer.baseCountwifiAccessPoints = answer.wifiAccessPoints.length
}

```

---

<div class="post-metadata">

### Author: ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)
#### Post date: [28 February 2019 16:08 UTC](https://discourse.nodered.org/t/something-to-convert-in-xml/8478/6 "2019-02-28T16:08:14Z")

</div>

```auto
msg["test-123"]=[];
msg["test-123"].push=({ ssid: "ssid", macAddress:"the mac address" });
return msg;

```

---

<div class="post-metadata">

### Author: ![jycemea](https://avatars.discourse-cdn.com/v4/letter/j/f475e1/32.png) [@jycemea](https://discourse.nodered.org/u/jycemea)
#### Post date: [28 February 2019 16:18 UTC](https://discourse.nodered.org/t/something-to-convert-in-xml/8478/7 "2019-02-28T16:18:03Z")

</div>

You saved my day !!! Thanks...
