G
Greg S
I have repeating nodes that contains attribute fields. Whenever I have to
add a new node in code, I've been using "cloneNode(true)" to copy an
existing node, or the blank default one created by InfoPath, as a quick way
to append new items. This has worked great until a situation occured where
the intial blank row doesn't exist. An example is when a user submit's via
email. When the recipient gets the email, the blank row is removed and I
have no way to add a new node that contains attributes. I can add the new
node without attributes, but any attempt to create an attribute results in
the InfoPath error:
The attribute 'x' on the element '{http://schemas...blah...blah..}mynode' is
not defined in the DTD/Schema.
But it *is* defined.
I've tried
mynode.setAttribute "x", "newvalue"
and
mynode.setAttribute "my:x", "newvalue"
and
set att = XDocument.DOM.createAttribute("my:x")
mynode.attributes.setNamedItem att
and
set att = XDocument.DOM.createAttribute("x")
mynode.attributes.setNamedItem att
I can set the attribute on the node before I append the node to the
document, but the minute I append the node to the doc it fails.
I've verified that the xml produced with the cloneNode method is identical
to what I'm trying to append. Any ideas? I've got to missing something
simple here.
thanks,
Greg
add a new node in code, I've been using "cloneNode(true)" to copy an
existing node, or the blank default one created by InfoPath, as a quick way
to append new items. This has worked great until a situation occured where
the intial blank row doesn't exist. An example is when a user submit's via
email. When the recipient gets the email, the blank row is removed and I
have no way to add a new node that contains attributes. I can add the new
node without attributes, but any attempt to create an attribute results in
the InfoPath error:
The attribute 'x' on the element '{http://schemas...blah...blah..}mynode' is
not defined in the DTD/Schema.
But it *is* defined.
I've tried
mynode.setAttribute "x", "newvalue"
and
mynode.setAttribute "my:x", "newvalue"
and
set att = XDocument.DOM.createAttribute("my:x")
mynode.attributes.setNamedItem att
and
set att = XDocument.DOM.createAttribute("x")
mynode.attributes.setNamedItem att
I can set the attribute on the node before I append the node to the
document, but the minute I append the node to the doc it fails.
I've verified that the xml produced with the cloneNode method is identical
to what I'm trying to append. Any ideas? I've got to missing something
simple here.
thanks,
Greg