General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Error when trying to set attribute value
-
MrPaul January 22, 2014 at 8:55 pm
Error when trying to set attribute value
January 22, 2014 at 8:55 pmParticipants 0Replies 1Last Activity 9 years agoHas anyone ever seen this error? I'm getting it when trying to set a DOMNode's attribute value.
“Error HRESULT E_FAIL has been returned from a call to a COM component.”
Not very descriptive I know, but when I try setting the attribute name to another value, the application crashes and that's the error returned.
My XML:
[code]If mNode IsNot Nothing AndAlso mNode.attributes.length > 0 AndAlso mNode.attributes.getNamedItem(“attName”) IsNot Nothing Then
mNode.attributes.getNamedItem(“attName”).nodeValue = “True”
End If[/code]Before calling this code, another call is made using the Range to set its ReadOnlyContainer to False, just in case. This code used to work using XMetal v3, but doesn't using XMAX v7. If you need more information, please let me know.
Thanks.
MrPaul January 23, 2014 at 4:02 pm
Reply to: Error when trying to set attribute value
January 23, 2014 at 4:02 pmMy issue has been resolved. It was related to setting range.ReadOnlyContainer = True for the root node of that document. Some other code prior to setting the attribute value was being called.
So, if you try to set nodeValue on a node that has been set as readonly (or its parent was set to readonly), it will return that error!
-
AuthorPosts
- You must be logged in to reply to this topic.