Thread: XML Parser
View Single Post
  #7  
Old 08-25-2006, 07:45 PM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Quote:
Originally Posted by ApothiX
Ah, I see what it's doing now, but I still stand by my saying I don't think you should be setting this, especially if you're just setting it as a string.
Because the way I have it is the only way I could figure out the recursion to work correctly. If I set the string inside of the function, any child that has children will be changed to that child's children. If you get what I'm saying.

PHP Code:
<key />
<
node id="1">
  <
childnode />
</
node
'me' would still be '<key />\n<node id="1">\n <childnode />\n</node>', but 'me.childNodes' would come up with <key /> and ' ,<childnode />'.
Yes, it is possible to change that, but it would be reparsing bits that have already been parsed.

And setting this is not harming anything. I am merely setting a variable a different way.

PHP Code:
new TGraalVar("me") {
  
this "This is perfectly acceptable.";

If I was setting the NPC's this, then it might be a problem.

Quote:
Originally Posted by ApothiX
Why not just make it set a 'me.parsedXML', and return an error code?

PHP Code:
with(me) {
  
temp.errorcode parseXML();
}

switch(
temp.errorcode) {
// Error Checking

Well, if I really wanted to follow ActionScript, I would set XML.status, which gives an error code.

e:
temp.before = strXML.substring(temp.test);
should be
temp.before = strXML.substring(0,temp.test);
in the code.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/

Last edited by Tolnaftate2004; 08-26-2006 at 01:45 AM..
Reply With Quote