HLRosenberger
asked on
DOM question
Can anyone tell me, is a documentElement object the same type of object that is created by createContextualFragment?
var range = document.createRange()
var newnode = range.createContextualFrag ment(rawxm l);
var range = document.createRange()
var newnode = range.createContextualFrag
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
ah, you misunderstood my question and/or I did not state it correctly. I mean is an object of type documentElement the same or equivalent to an object created by createContextualFragment?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
it works! does what I need.
ASKER
I actually using D3 and SVG as well and the resulting newnode that I add is not acting as it should as far as D3 methods and SVG. I know this explaination is outside the scope of my question, but I'm just providing some context. I'm guessing that I'm having issues because I'm create a fragment out of something that is not a fragment, but a full-blown SVG/XML file.
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 1040 792" style="enable-background:n
<style type="text/css">
.st1{fill:#8cc800;stroke:#
.st2{fill:black;}
</style>
<g id="airport" >
<g id="section-postSecurity" >
<path id="postSecurity" class="st1" d="M665.8,636.7c0-6.7,0-13
s0-42,0-42s-128,2-128,0s0-
c0.7-2-27.3-80.7-27.3-80.7
v7.7h-30V559h62v10.6h-66.7
<text transform="matrix(1 0 0 1 550 400)" class="st2" >Post-Security</text>
</g>
<g id="section-preSecurity" class="st0">
<polygon id="preSecurity" class="st1" points="446,648.5 666.9,635.3 1028.3,635.3 1028.3,723.3 962,723.3 962,729 930,729 930,749 9.7,749
9.7,652.3 29.7,652.3 29.7,612 77.3,612 77.3,619 407,619 406.8,611.6 414.5,611.6 429.1,626.3 429.1,634.3 436.5,634.3
436.5,648.3 445.1,648.3 "/>
<text transform="matrix(1 0 0 1 500 700)" class="st2" >Pre-Security</text>
</g>
</g>
</svg>