Opened 14 years ago

Closed 14 years ago

Last modified 12 years ago

#187 closed defect (duplicate)

dojo.xml.Parse().parseElement() fails when directly parsing an inline constructor node

Reported by: alex Owned by: dylan
Priority: high Milestone:
Component: General Version: 0.1
Keywords: Cc: alex@…
Blocked By: Blocking:

Description

The bug can be most easily be described in terms of using djConfig.searchIds. This should work:

<script>
  djConfig.searchIds = ["foo"];
</script>
<span dojoType="widget" id="foo" />

But instead, it's necessaray to do:

<script>
  djConfig.searchIds = ["foo"];
</script>
<span id="foo">
    <span dojoType="widget" />
</span>

This is true for parsing any inline constructor node directly. Similarly, dojo.widget.Parse is required to jump through some significant hierarchy munging in order to directly create a widget in place.

Something is very wrong with how the first-pass parser treats constructor nodes.

Change History (6)

comment:1 Changed 14 years ago by alex

Milestone: 0.2release0.3release

dylan advises that he won't fix for 0.2. Moving off to 0.3

comment:2 Changed 14 years ago by dylan

Status: newassigned

comment:3 Changed 14 years ago by anonymous

I think it would be perfect workaround to incorporate; if we had parsed the parent-node of the given searchid instead of the target id.

This would look like in hostenv_browser.js 's makeWidgets function:

 var parser = new dojo.xml.Parse();
 if(sids.length > 0){
     for(var x=0; x<sids.length; x++){
        var tmpNode = document.getElementById(sids[x]);
        if(!tmpNode){ continue; }
     
        /// temporary fix for bug #187: parse the searchids-node's parent!
        tmpNode = tmpNode.parentNode;

	var frag = parser.parseElement(tmpNode, null, true);
	dojo.widget.getParser().createComponents(frag);
     }

comment:4 Changed 14 years ago by sjmiles

Resolution: duplicate
Status: assignedclosed

See ticket #33

comment:5 Changed 14 years ago by anonymous

this way is usful only for HTML parsing but wht about the XML....

comment:6 Changed 12 years ago by (none)

Milestone: 0.3release

Milestone 0.3release deleted

Note: See TracTickets for help on using tickets.