• XML in JS

    From MCMLXXIX@MDJ to Digital Man on Friday, August 06, 2010 14:57:39
    I've been messing around with some XML data files and manipulating them within a script, then writing them back out.

    Somewhere in this process (either deleting an item or adding one) some weird stuff is happening, and I'm not sure if it's something I should be doing differently or if it's just the way it is.

    I'll post an example of exactly what im doing and what the result is when I can narrow it down, but the end result is that a huge amount of commas and spaces are getting thrown into the XML object, leaving the file looking something like this:

    <blahblah>
    , , , ,,,,,,,
    <blah>
    , , , ,,,,,,,
    </blah>
    , , , ,,,,,,,
    </blahblah>

    it doesnt seem to corrupt the data, but after reading it back in, doing some work, and writing it back out a few dozen times, it gets really messy.


    ---
    ■ Synchronet ■ The BRoKEN BuBBLE (MDJ.ATH.CX)
  • From Digital Man to MCMLXXIX on Monday, August 09, 2010 15:44:09
    Re: XML in JS
    By: MCMLXXIX to Digital Man on Fri Aug 06 2010 02:57 pm

    I've been messing around with some XML data files and manipulating them within a script, then writing them back out.

    Somewhere in this process (either deleting an item or adding one) some
    weird stuff is happening, and I'm not sure if it's something I should be doing differently or if it's just the way it is.

    I'll post an example of exactly what im doing and what the result is when I can narrow it down, but the end result is that a huge amount of commas and spaces are getting thrown into the XML object, leaving the file looking something like this:

    <blahblah>
    , , , ,,,,,,,
    <blah>
    , , , ,,,,,,,
    </blah>
    , , , ,,,,,,,
    </blahblah>

    it doesnt seem to corrupt the data, but after reading it back in, doing
    some work, and writing it back out a few dozen times, it gets really messy.

    Are you using the built-in XML support (E4X) in JavaScript (ECMAScript)?

    Without seeing the code, it's hard to diagnose the cause.

    digital man

    Snapple "Real Fact" #80:
    About 18% of Animal owners share their bed with their pet.
  • From MCMLXXIX@MDJ to Digital Man on Monday, August 09, 2010 21:55:48
    Re: XML in JS
    By: Digital Man to MCMLXXIX on Mon Aug 09 2010 15:44:09

    Re: XML in JS
    By: MCMLXXIX to Digital Man on Fri Aug 06 2010 02:57 pm

    I've been messing around with some XML data files and manipulating them within a script, then writing them back out.

    Somewhere in this process (either deleting an item or adding one) some weird stuff is happening, and I'm not sure if it's something I should be doing differently or if it's just the way it is.

    I'll post an example of exactly what im doing and what the result is when can narrow it down, but the end result is that a huge amount of commas an spaces are getting thrown into the XML object, leaving the file looking something like this:

    <blahblah>
    , , , ,,,,,,,
    <blah>
    , , , ,,,,,,,
    </blah>
    , , , ,,,,,,,
    </blahblah>

    it doesnt seem to corrupt the data, but after reading it back in, doing some work, and writing it back out a few dozen times, it gets really mess

    Are you using the built-in XML support (E4X) in JavaScript (ECMAScript)?

    Without seeing the code, it's hard to diagnose the cause.

    digital man



    yes built in. I'm still not sure what exactly is doing it, so I'll have to mess around with it more, but I've had some crashes as a result of bad XML syntax as well (not failure to compile, but jsexec crashes)

    though the above still has yet to corrupt anything, its just a nuisance

    ---
    ■ Synchronet ■ The BRoKEN BuBBLE (MDJ.ATH.CX)