#145 ✓resolved
nickg

e4x investigation

Reported by nickg | March 31st, 2010 @ 04:26 PM

Oooh took me a while to figure this out. I added the comment.

from src/dom/domparser.js

DOMParser = function(principle, documentURI, baseURI){};
__extend__(DOMParser.prototype,{
    parseFromString: function(xmlstring, mimetype){
        var doc = new Document(new DOMImplementation()),
            e4;

        // TODO: JAVA ALERT -- 'XML' is a global object                                              
        //  not sure if this is envjs-special? or a normal java thing                                
        // if (XML) {  ????                                                                          
        XML.ignoreComments = false;
        XML.ignoreProcessingInstructions = false;
        XML.ignoreWhitespace = false;

        xmlstring = xmlstring.replace(/<\?xml.*\?>/);

        e4 = new XMLList(xmlstring);

        __toDomNode__(e4, doc, doc);

        //console.log('xml \n %s', doc.documentElement.xml);                                         
        return doc;

    }
});

whaddya think...

Comments and changes to this ticket

  • Thatcher

    Thatcher March 31st, 2010 @ 04:38 PM

    Nick, XML and XMLNode are the interfaces exposed by the E4X.

  • nickg

    nickg April 2nd, 2010 @ 12:19 PM

    • State changed from “new” to “open”
    • Assigned user changed from “Thatcher” to “nickg”
    • Title changed from “secret embedded java in dom/domparser.js” to “e4x investigation”

    hahah

    Yah I just figured it out.

    For some reason spidnermonkey isn't doing the right thing with it....

  • nickg

    nickg April 2nd, 2010 @ 12:50 PM

    add rules to JSLint to ignore XML, XMLList.

  • nickg

    nickg April 11th, 2010 @ 01:43 PM

    • State changed from “open” to “resolved”

    Rhino:

    attributenode.text() == attributenode.valueOf() == the value

    Spidermonkey

    attr.text() == ""
    attr.valueOf == the value

    Who knows what is correct but I changed the attribute processing code to use valueOf which works in both.

    Added a ton of notes as well.

    Resolving.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

a javascript browser environment

People watching this ticket

Pages