2 things, first, define onData before you call load.

Second, the first character in the str is "<" not "?".  So, you'll have to 
either hardcode where the ? you are looking for is showing up, or parse it 
out using the String functions.

----- Original Message ----- 
From: "Josh Gormley" <[EMAIL PROTECTED]>
To: "Flashcoders mailing list" <[email protected]>
Sent: Friday, November 04, 2005 5:21 PM
Subject: Re: [Flashcoders] XML processing instructions


thanks for the quick response, but unfortunately it didn't work.

if I add a trace(this) right after the this.onLoad(true) line, I only
get the XML structure up to the point of the processing
instructions.  Here is the code I'm using:

myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("data/data.xml");

myXML.onData = function(src) {
     if(src.substr(0, 1) != "?")
{
this.loaded = true;
this.parseXML(src);
this.onLoad(true);
trace(this);
}
}

My XML looks like this:

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE data SYSTEM "data-schema.dtd">
<?altova_sps blah.sps?>
<data>
<gameSettings>
<SNIPPED>

And the trace from the code above returns this:

<?xml version="1.0" encoding="iso-8859-1"?><!DOCTYPE data SYSTEM
"data-schema.dtd">

any thoughts?

Josh


On Nov 4, 2005, at 3:44 PM, JesterXL wrote:

> Use onData instead of onLoad.
>
> my_xml = new XML();
> my_xml.onData = function(str)
> {
>     if(str.substr(0, 1) != "?")
>     {
>         this.loaded = true;
>         this.parseXML(str);
>         this.onLoad(true);
>     }
> };
>


_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders 

_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Reply via email to