Help With DOM Creation From Script

I am having trouble with the code below. It emulates fine on the PC, but the Toshiba player is having problems with the createElement line. It is leading to a HDDVD_E_INVALIDCALL error on the player.

Bookmark = null;
results = new Object();

results["bookmark"] = XMLParser.parseString("<bookmarks></bookmarks>");
Bookmark = results["bookmark"].createElement("BOOKMARK_FILLER");
Bookmark.setAttribute("title","INIT_FILLER");
Bookmark.setAttribute("time","00:00:00:00");
results["bookmark"].documentElement.appendChild(Bookmark);



Answer this question

Help With DOM Creation From Script

  • Azeem Sarwar

    Have you been able to try this on any other software players, like on the Qosmio I will see if we can find an answer from Toshiba... no promises though.

    Have you updated to the 2.0 firmware Although that shouldn't matter since Warner was doing bookmarks at launch with 1.0 firmware.



  • KannanPV

    Can you create any thing else An attribute, for example

  • johnvarney

    Peter, unforunately I do not have access to another player, hardware or software. I hope to soon have a few emulators from Toshiba. The player gave me the same results with both 1.4 and 2.0 firmware releases.

    Thanks for the help and asking Toshiba. That's definitely beyond what I would have expected.


  • Mchafu

    I haven't tried the createAttribute method. I can give it a try when I am back in the office.

    I rewrote the code again. I am still getting the same error, in the same spot. I added some variables to print out to the screen to get a better idea of what is failing and where. Once the string value is parsered by the XMLParser, I can access it without an issue. All of the reading methods work, but writing to it will not.

    function BookmarkMaker()
    {
    this.savedBookmarks = null;
    }

    BookmarkMaker.prototype.init = function()
    {
    this.savedBookmarks = XMLParser.parseString("<bookmarks></bookmarks>");
    var title = "Green";
    var time = "00:00:00:00";
    this.add(title, time);
    };

    BookmarkMaker.prototype.add = function(title, time)
    {
    try
    {
    var length = this.savedBookmarks.documentElement.childNodes.length;
    var tempBookmark = null;
    line = "26";
    tempBookmark = this.savedBookmarks.createElement("bookmark");
    line = "28";
    tempBookmark.setAttribute("title",title);
    tempBookmark.setAttribute("time",time);
    line="31";
    this.savedBookmarks.documentElement.appendChild(tempBookmark);
    document.errors.state.value = "DOM Created";
    }
    catch(e)
    {
    document.errors.state.value = "Bookmark Init Failure : Line "+line+", "+e+" -- "+title+", "+time+", "+length;
    }
    };


  • sebastian_v_b

    "Bookmark" is a predefined object (Z.10.3); try calling your variable something else.



  • Gabriel3

    Peter,

    I changed the name. I'm surprised that I didn't see that before. But, it didn't work. I still get the same error. Hmmm.....


  • Rob Harris

    Update: We believe this may be based on the use of parseString instead of createDocument to create the initial XML document.

  • kawano1h

    I have made it even simpler than before and it is still not working.Any suggestion as to why is much appreciated.

    Bookmark = null;
    results = null;

    results = XMLParser.parseString("<bookmarks></bookmarks>");
    Bookmark = results.createElement("bookmark");
    Bookmark.setAttribute("title","INIT");
    Bookmark.setAttribute("time","00:00:00:00");
    results.documentElement.appendChild(Bookmark);


  • Help With DOM Creation From Script