Zath
08-18-2005, 08:19 PM
I have an xml file with a structure...
<obj>
<lesson>
<title>Course Instructions</title>
<type>INSTRUCTIONS</type>
<to>text here</to>
<eos>
<eo>text here</eo>
</eos>
<topic>
<title>some title</title>
<fileLocation>somefile.xml</fileLocation>
</topic>
</lesson>
<lesson>
<title>Background Test</title>
<type>TEST</type>
<offset>0</offset>
<test>
<name>Intro</name>
<identifier>123456</identifier>
<remediate>1</remediate>
</test>
</lesson>
</obj>
And the xml file is read with the code below....
this._test_xml = new XML;
this._test_xml.ignoreWhite = true;
this._test_xml.onLoad = Delegate.create( this, loadStructure );
this._test_xml.load( "myfile.xml");
public function loadStructure( xmlFile):Void
{
//where the file nodes are read and pushed into arrays
}
Under certain conditions, I do NOT want the entire <lesson> node read at all or removed right after the file is read if the <type> is TEST before it goes into the loadStructure function.
Is there a way to do this I have overlooked?
Thanks,
<obj>
<lesson>
<title>Course Instructions</title>
<type>INSTRUCTIONS</type>
<to>text here</to>
<eos>
<eo>text here</eo>
</eos>
<topic>
<title>some title</title>
<fileLocation>somefile.xml</fileLocation>
</topic>
</lesson>
<lesson>
<title>Background Test</title>
<type>TEST</type>
<offset>0</offset>
<test>
<name>Intro</name>
<identifier>123456</identifier>
<remediate>1</remediate>
</test>
</lesson>
</obj>
And the xml file is read with the code below....
this._test_xml = new XML;
this._test_xml.ignoreWhite = true;
this._test_xml.onLoad = Delegate.create( this, loadStructure );
this._test_xml.load( "myfile.xml");
public function loadStructure( xmlFile):Void
{
//where the file nodes are read and pushed into arrays
}
Under certain conditions, I do NOT want the entire <lesson> node read at all or removed right after the file is read if the <type> is TEST before it goes into the loadStructure function.
Is there a way to do this I have overlooked?
Thanks,