# XML problems... Geeze!

**URL:** <https://forum.kirupa.com/t/xml-problems-geeze/34536>\
**Category:** flash\
**Created:** [November 3, 2003, 8:43pm UTC](https://forum.kirupa.com/t/xml-problems-geeze/34536 "2003-11-03T20:43:21Z")\
**Posts on this page:** 5\
**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 3, 2003, 8:43pm UTC](https://forum.kirupa.com/t/xml-problems-geeze/34536/1 "2003-11-03T20:43:21Z")

</div>

Hello all,

# I have a simple external XML file :

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

# I have a simple loading script on a key frame :

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

On my scene, I have 2 dynamic text fields.  
One called content1, the other called content2.

I want my textfield named content1 to show the content of the nouvelle1 variable (news.firstChild).  
and my textfield named content2 to show the content of the nouvelle2 variable (news.nouvelle1.nextSibling).

What do I need to do?  
I have tried to write “nouvelle1” in the Var field of my content1 textfield and “nouvelle2” in the Var field of my content2 textfield but this doesn’t work.

Any ideas would be appreciated.

Thanks! :}

neuhaus3000

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 4, 2003, 1:44am UTC](https://forum.kirupa.com/t/xml-problems-geeze/34536/2 "2003-11-04T01:44:57Z")

</div>

instead of this:

news = new LoadVars();

use this:

news = new XML();  
news.ignoreWhite = true;

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 4, 2003, 2:10am UTC](https://forum.kirupa.com/t/xml-problems-geeze/34536/3 "2003-11-04T02:10:48Z")

</div>

HA HA ! :thumb:

Yes mi friend! That’s it!

Works fine now.

Thanks a million! :beam:

neuhaus3000

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 4, 2003, 2:25am UTC](https://forum.kirupa.com/t/xml-problems-geeze/34536/4 "2003-11-04T02:25:54Z")

</div>

welcome

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [November 4, 2003, 6:55pm UTC](https://forum.kirupa.com/t/xml-problems-geeze/34536/5 "2003-11-04T18:55:46Z")

</div>

Hey rysolag,

# I’ve changed my loading script to…

# 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”); } } stop();

I can see texte in my textfields called nouvelle1 and nouvelle2  
but it looks like :  
\<nouvelle1\>This is content 1\</nouvelle1\>  
and  
\<nouvelle2\>This is content 2\</nouvelle2\>

The tags are included in the content.  
All I want to see are the elements from these tags…  
Any ideas? I’ve read something about the _attributes_ object  
but I can’t quite understand how to use it.

Thanks! 😃

neuhaus3000
