# Reading Attributes in XML

**URL:** <https://forum.kirupa.com/t/reading-attributes-in-xml/36063>\
**Category:** flash\
**Created:** [November 21, 2003, 3:29pm UTC](https://forum.kirupa.com/t/reading-attributes-in-xml/36063 "2003-11-21T15:29:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neuhaus3000](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/neuhaus3000/32/168_2.png) [@Neuhaus3000](https://forum.kirupa.com/u/Neuhaus3000)\
**Post date:** [November 21, 2003, 3:29pm UTC](https://forum.kirupa.com/t/reading-attributes-in-xml/36063/1 "2003-11-21T15:29:53Z")

</div>

Hey,

Does anyone know how to read attributes in XML?

# This is my frame ActionScript.

# news = new XML(); news.ignoreWhite = true; news.load(“nouvelles.xml”); news.onLoad = function(success){ if(success){ rootNode = news.firstChild; nouvelle1 = rootNode.firstChild; nouvelle2 = nouvelle1.nextSibling; } else { trace (“Error while loading file”); } }

# This is my nouvelles.xml external document:

# \<?xml version=“1.0” encoding=“iso-8859-1”?\> \<nouveautes\> \<nouvelle1\>This is news 1\</nouvelle1\> \<nouvelle2\>This is news 2\</nouvelle2\> \</nouveautes\>

I have 2 text fields in my movie.  
One that will read the attributes of \<nouvelle 1\>\</nouvelle1\>  
and the other the attributes of \<nouvelle 2\>\</nouvelle2\>.

But what is showing in the textfields is :  
textfield #1 = \<nouvelle1\>This is news 1\</nouvelle1\>  
and  
textfield #2 = \<nouvelle2\>This is news 2\</nouvelle2\>

I just want the “This is news 1” and “This is news 2” without the \<nouvelle1\>\</nouvelle1\> and \<nouvelle2\>\</nouvelle2\> tags.

Any ideas what’s missing in my frame actionScript?

Thanks! :beam:

neuhaus3000
