A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: problems with XML....

  1. #1
    Junior Member
    Join Date
    Mar 2001
    Posts
    19
    Ok I'm creating an XML object on the first frame and loading an XML file I made up...I am currently in the beginning phases of a project and I am tryign to wrote a parser for the XML object...

    BUT...it seems the XML file isn't being loaded into the Object correctly..

    so here is the output from "list variables" when you are testing a movie

    Level #0:
    Variable _level0.$version = "WIN 5,0,30,0"
    Variable _level0.myXMLParser = [function]
    Variable _level0.mystring = ""
    Variable _level0.myXMLObj = [object #2] {
    nodeType:1,
    nextSibling:null,
    previousSibling:null,
    parentNode:null,
    firstChild:[object #3] {
    nodeType:1,
    nextSibling:null,
    previousSibling:undefined,
    parentNode:[object #2],
    firstChild:[object #4] {
    nodeType:1,
    nextSibling:[object #5] {
    nodeType:1,
    nextSibling:[object #6] {
    nodeType:1,
    nextSibling:null,
    previousSibling:[object #5],
    parentNode:[object #3],
    firstChild:[object #7] {
    nodeType:1,
    nextSibling:[object #8] {
    nodeType:1,
    nextSibling:null,
    previousSibling:[object #7],
    parentNode:[object #6],
    firstChild:[object #9] {
    nodeType:3,
    nextSibling:null,
    previousSibling:null,
    parentNode:[object #8],
    firstChild:null,
    lastChild:null,
    childNodes:[object #10] [],
    attributes:[object #11] {},
    nodeName:null,
    nodeValue:"BigCheese"
    },
    lastChild:[object #9],
    childNodes:[object #12] [
    0:[object #9]
    ],
    attributes:[object #13] {
    status:"supervisor"
    },
    nodeName:"NAME",
    nodeValue:null
    },
    previousSibling:null,
    parentNode:[object #6],
    firstChild:[object #14] {
    nodeType:3,
    nextSibling:null,
    previousSibling:null,
    parentNode:[object #7],
    firstChild:null,
    lastChild:null,
    childNodes:[object #15] [],
    attributes:[object #16] {},
    nodeName:null,
    nodeValue:"Hello this is test text in my XML document"
    },
    lastChild:[object #14],
    childNodes:[object #17] [
    0:[object #14]
    ],
    attributes:[object #18] {},
    nodeName:"TEXT",
    nodeValue:null
    },
    lastChild:[object #8],
    childNodes:[object #19] [
    0:[object #7],
    1:[object #8]
    ],
    attributes:[object #20] {},
    nodeName:"MESSAGE",
    nodeValue:null
    },
    previousSibling:[object #4],
    parentNode:[object #3],
    firstChild:[object #21] {
    nodeType:1,
    nextSibling:[object #22] {
    nodeType:1,
    nextSibling:null,
    previousSibling:[object #21],
    parentNode:[object #5],
    firstChild:[object #23] {
    nodeType:3,
    nextSibling:null,
    previousSibling:null,
    parentNode:[object #22],
    firstChild:null,
    lastChild:null,
    childNodes:[object #24] [],
    attributes:[object #25] {},
    nodeName:null,
    nodeValue:"JoannaDeal"
    },
    lastChild:[object #23],
    childNodes:[object #26] [
    0:[object #23]
    ],
    attributes:[object #27] {
    status:"dealer"
    },
    nodeName:"NAME",
    nodeValue:null
    },
    previousSibling:null,
    parentNode:[object #5],
    firstChild:[object #28] {
    nodeType:3,
    nextSibling:null,
    previousSibling:null,
    parentNode:[object #21],
    firstChild:null,
    lastChild:null,
    childNodes:[object #29] [],
    attributes:[object #30] {},
    nodeName:null,
    nodeValue:"Hello this is test text in my XML document"
    },
    lastChild:[object #28],
    childNodes:[object #31] [
    0:[object #28]
    ],
    attributes:[object #32] {},
    nodeName:"TEXT",
    nodeValue:null
    },
    lastChild:[object #22],
    childNodes:[object #33] [
    0:[object #21],
    1:[object #22]
    ],
    attributes:[object #34] {},
    nodeName:"MESSAGE",
    nodeValue:null
    },
    previousSibling:null,
    parentNode:[object #3],
    firstChild:[object #35] {
    nodeType:1,
    nextSibling:[object #36] {
    nodeType:1,
    nextSibling:null,
    previousSibling:[object #35],
    parentNode:[object #4],
    firstChild:[object #37] {
    nodeType:3,
    nextSibling:null,
    previousSibling:null,
    parentNode:[object #36],
    firstChild:null,
    lastChild:null,
    childNodes:[object #38] [],
    attributes:[object #39] {},
    nodeName:null,
    nodeValue:"Joanna"
    },
    lastChild:[object #37],
    childNodes:[object #40] [
    0:[object #37]
    ],
    attributes:[object #41] {},
    nodeName:"NAME",
    nodeValue:null
    },
    previousSibling:null,
    parentNode:[object #4],
    firstChild:[object #42] {
    nodeType:3,
    nextSibling:null,
    previousSibling:null,
    parentNode:[object #35],
    firstChild:null,
    lastChild:null,
    childNodes:[object #43] [],
    attributes:[object #44] {},
    nodeName:null,
    nodeValue:"HellothisistesttextinmyXMLdocument"
    },
    lastChild:[object #42],
    childNodes:[object #45] [
    0:[object #42]
    ],
    attributes:[object #46] {},
    nodeName:"TEXT",
    nodeValue:null
    },
    lastChild:[object #36],
    childNodes:[object #47] [
    0:[object #35],
    1:[object #36]
    ],
    attributes:[object #48] {},
    nodeName:"MESSAGE",
    nodeValue:null
    },
    lastChild:[object #6],
    childNodes:[object #49] [
    0:[object #4],
    1:[object #5],
    2:[object #6]
    ],
    attributes:[object #50] {},
    nodeName:"ROOM",
    nodeValue:null
    },
    lastChild:[object #3],
    childNodes:[object #51] [
    0:undefined,
    1:[object #3]
    ],
    attributes:[object #52] {},
    nodeName:null,
    nodeValue:null,
    xmlDecl:"<?xml version=\"1.0\"?>",
    docTypeDecl:undefined,
    status:0,
    loaded:true,
    onLoad:[object #1],
    ignoreWhite:1
    }
    Variable _level0.parsedData = [object #53] []
    Variable _level0.k = 4
    Variable _level0.mainNode = [object #3]
    Variable _level0.mainName = "ROOM"
    Variable _level0.childrenOfMain = [object #49]
    Variable _level0.i = 4
    Variable _level0.thisNode = [object #6]
    Variable _level0.nodesOfThisChild = [object #19]
    Variable _level0.j = 3
    Variable _level0.thisTag = undefined
    Variable _level0.thisTagName = undefined
    Variable _level0.messageText = null
    Variable _level0.messageSender = null

    yeah its confusing I know....and here is my XML file

    <?xml version="1.0"?><ROOM>
    <MESSAGE>
    <TEXT>HellothisistesttextinmyXMLdocument</TEXT>
    <NAME>Joanna</NAME>
    </MESSAGE>
    <MESSAGE>
    <TEXT>Hello this is test text</TEXT>
    <NAME status="dealer">JoannaDeal</NAME>
    </MESSAGE>
    <MESSAGE>
    <TEXT>Hello this is test text in</TEXT>
    <NAME status="supervisor">BigCheese</NAME>
    </MESSAGE>
    </ROOM>

    I have tried it all crammed together with no whitespace except for in the tags themselves and it produces no different results

    Any advice...tips...whatever would be appreciated


  2. #2
    Junior Member
    Join Date
    Mar 2001
    Posts
    19
    argh....well it took out all my tags in my XML file when I posted...grr...well you see it gets it right hehe

    grrr....ok this stupid thing cuts out the tags no matter what I do...so maybe I can put the XML file up somewhere for you to see...but there is nothing special about it.

  3. #3
    Junior Member
    Join Date
    Mar 2001
    Posts
    19

  4. #4
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh....

    Yeah.. this is my car.. and I'm having problems - it won't drive straight... but you can't look under the hood....



    It would help a lot if you posted your code, instead of making us guess what your code is....

  5. #5
    Junior Member
    Join Date
    Mar 2001
    Posts
    19
    well I figured out what the problem is,

    I guess in my first post I didn't make clear what the problem was... all I was doing was importing an XML into an XML object in flash and it was producing results that I wasn't expecting. I wasn't expecting those results cause the Text Book I was using was...ehem...well it was misleading to say the least.

    Anyway...no bother I got it fixed

  6. #6
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Ok...

    What were you mislead in? Maybe we could learn from you....

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center