# Parsing XML

**URL:** <https://forum.kirupa.com/t/parsing-xml/308619>\
**Category:** Uncategorized\
**Created:** [April 27, 2010, 6:19am UTC](https://forum.kirupa.com/t/parsing-xml/308619 "2010-04-27T06:19:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![oscarD](https://avatars.discourse-cdn.com/v4/letter/o/c68b51/32.png) [@oscarD](https://forum.kirupa.com/u/oscarD)\
**Post date:** [April 27, 2010, 6:19am UTC](https://forum.kirupa.com/t/parsing-xml/308619/1 "2010-04-27T06:19:58Z")

</div>

I have been through the tutorials but am having trouble parsing my xml file. I am working with an xml file from an epub book. The file looks like this:

\<?xml version=“1.0” encoding=“utf-8”?\>  
\<html xmlns=“[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)” xml:lang=“en”\>  
\<head\>  
\<meta name=“generator” content=  
“HTML Tidy for FreeBSD (vers 25 March 2009), see [www.w3.org](http://www.w3.org)” /\>  
\<title\>The Adventures of Sherlock Holmes\</title\>  
\<link rel=“stylesheet” href=“css/main.css” type=“text/css” /\>  
\<meta http-equiv=“Content-Type” content=  
“application/xhtml+xml; charset=utf-8” /\>  
\</head\>  
\<body\>  
\<div class=“body”\>  
\<div id=“chapter\_38321” class=“chapter”\>  
\<h2\>\<span class=“chapterHeader”\>\<span class=  
“translation”\>Chapter\</span\> \<span class=  
“count”\>1\</span\>\</span\>\</h2\>  
\<p\> \</p\>  
\<div class=“text”\>  
\<p\>To Sherlock Holmes …\</p\>  
\<p\>I had …\</p\>  
\</div\>  
\</div\>  
\</div\>  
\</body\>  
\</html\>

var testLoader:URLLoader  
testLoader=new URLLoader(new URLRequest(“file.xml”));  
testLoader.addEventListener(Event.COMPLETE, xmlTestDownloaded);

function xmlTestDownloaded(event:Event):void {  
var xmlData:XML=new XML(event.target.data);  
trace(xmlData);  
}

The trace here will spit out all of the file so I know it is loading. However, I’ve tried everything I can think of to get the \<title\> and \<p\> sections, but I do not seem to get anything.

Any help would be greatly appreciated.

Thanks,

oscarD
