Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Displaying XML ENTITY's in Flash (or at least grabing it)

Status
Not open for further replies.

awesomebeats

Technical User
Nov 29, 2001
25
US
Hey,
I use the following actionscript to grab some xml from a file and display is contents. The problem is that this node contains and entity call &text; and flash displays "&text;" not the value of the entity. How can I make flash display the value of the entity? Here's my script in flash and the xml is below. Thanx for your help!

testxml = new xml();
testxml.ignoreWhite=true;
testxml.load("test.xml");
testxml.onLoad = parse;
function parse() {
text = testxml.firstChild.firstChild.firstChild.nextSibling.firstChild.nodeValue;
}

stop();

awesomebeats
<?xml version=&quot;1.0&quot; encoding=&quot;iso-8859-1&quot;?>
<!DOCTYPE test[
<!ELEMENT test (subject*)>
<!ELEMENT subject (title, info, writ*)>
<!ELEMENT title (#PCDATA)>
<!ATTLIST title date CDATA #IMPLIED>
<!ELEMENT info (#PCDATA)>
<!ELEMENT writ (#PCDATA)>
<!ATTLIST writ age CDATA #IMPLIED>
<!ENTITY text &quot;SHould put lots of text here cause that's what goes here!&quot;>
]>
<test>
<subject>
<title date=&quot;May 20, 1998&quot;>Juan Dumb Boy</title>
<info>Last seen robbing his mother at 1823 Stupid Ave, Anaheim. &text;</info>
<writ age=&quot;32&quot;>He's an old man for sure!</writ>
</subject>
</test>

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top