# Extends XML Build-in class

**URL:** https://forum.kirupa.com/t/extends-xml-build-in-class/145031
**Category:** Uncategorized
**Created:** [April 19, 2005, 9:49am UTC](https://forum.kirupa.com/t/extends-xml-build-in-class/145031 "2005-04-19T09:49:59Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![grantchiu](https://avatars.discourse-cdn.com/v4/letter/g/ce73a5/32.png) [@grantchiu](https://forum.kirupa.com/u/grantchiu)
#### Post date: [April 19, 2005, 9:49am UTC](https://forum.kirupa.com/t/extends-xml-build-in-class/145031/1 "2005-04-19T09:49:59Z")

</div>

The following is my code …  
I want the extends the XML class to my custom class(XMLReader),  
But i find that i cannot get the firstChild after success load the XML .  
Please help ~!  
What’s wrong for my coding ~!

[font=Courier New][color=green]function XMLReader() {  
}  
// Construct an XML object to hold the server’s reply  
XMLReader.prototype = new XML();  
//ignore XML white space  
XMLReader.prototype.ignoreWhite = true;  
// this function triggers when an XML packet is received from the server.  
XMLReader.prototype.load = function(success) {  
if (success) {  
trace(“SUCCESS”);  
[color=darkred]trace(this);  
[/color] } else {  
trace(“FAILED”);  
}  
};  
XMLReader.prototype.getRoot = function() {  
[color=darkred]return super.firstChild;  
[/color]};[/color][/font]  
[font=Courier New][/font]

```auto

```

```auto

```

[font=Courier New][color=green]  
XMLReader = new XMLReader();  
XMLReader.load("[/color][/font][[font=Courier New][color=green]http://localhost:8103/Category.xml[/color][/font]](http://localhost:8103/Category.xml)[font=Courier New][color=green]");  
trace(XMLReader.getRoot());

[/color][/font]
