M
Miguel De Anda
I've made a little tool that I use to read and use xml files. I've made a
method that would return a desired node from the dom, and if it isn't found,
it will add it. So for example if I have the tree:
<a>
<b id="0">
<c>value of c</c>
</b>
</a>
and I call getNode("a.b.c") then it returns the node "c" which has the value
of "value of c" in it. I'm trying to extend that a bit and also allow it to
get attributes (I hope I'm even calling them right, but the id="0" part in
the example above).
I haven't tested the reading part yet but I was trying to add it using the
code:
Node abc = ...
Node id = document.createAttribute("id");
abc.appendChild(id);
and I get a "HEIRARCY_REQUEST_ERR: An attempt was made to insert a node
where it is not permitted". How am I supposed to do this? Thanks in advance.
Miguel.
method that would return a desired node from the dom, and if it isn't found,
it will add it. So for example if I have the tree:
<a>
<b id="0">
<c>value of c</c>
</b>
</a>
and I call getNode("a.b.c") then it returns the node "c" which has the value
of "value of c" in it. I'm trying to extend that a bit and also allow it to
get attributes (I hope I'm even calling them right, but the id="0" part in
the example above).
I haven't tested the reading part yet but I was trying to add it using the
code:
Node abc = ...
Node id = document.createAttribute("id");
abc.appendChild(id);
and I get a "HEIRARCY_REQUEST_ERR: An attempt was made to insert a node
where it is not permitted". How am I supposed to do this? Thanks in advance.
Miguel.