# Create a link from xml

**URL:** <https://forum.kirupa.com/t/create-a-link-from-xml/103689>\
**Category:** Uncategorized\
**Created:** [March 8, 2004, 9:33am UTC](https://forum.kirupa.com/t/create-a-link-from-xml/103689 "2004-03-08T09:33:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flashmatazz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/flashmatazz/32/140_2.png) [@Flashmatazz](https://forum.kirupa.com/u/Flashmatazz)\
**Post date:** [March 8, 2004, 9:33am UTC](https://forum.kirupa.com/t/create-a-link-from-xml/103689/1 "2004-03-08T09:33:24Z")

</div>

I’m trying to create a link in a html enabled textfield, using an xml file.

However somehow this doesn’t work:

```auto

main["item"+i].title.html = true;
trace(my_XML.firstChild.childNodes*.attributes.action); // traces the attribute containing the url correctly
main["item"+i].title.htmlText = "<a href=\"" + my_XML.firstChild.childNodes*.attributes.action + "\" target=\"_blank\">";
main["item"+i].title.htmlText += my_XML.firstChild.childNodes*.attributes.title;
main["item"+i].title.htmlText += "</a>";
main["item"+i].title.setTextFormat(titleFormat);

```

When I debug, I see the ending \< /a\> tag showing up but not the begintag and the contents of action attribute.

I tested the following and this actually does work:

```auto

myURL = "http://www.kirupa.com";
this.createTextField("myField", 1, 0, 0, 100, 20);
myField.html = true;
myField.htmlText = "<a href=\"" + myURL + "\" target=\"_blank\">" + myURL;
myField.htmlText += "</a>";

```

How come??
