General XMetaL Discussion

XMetaL Community Forum General XMetaL Discussion Error when trying to set attribute value

  • MrPaul

    Error when trying to set attribute value

    Participants 0
    Replies 1
    Last Activity 9 years ago

    Has 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.




    Reply to: Error when trying to set attribute value

    My 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!


  • You must be logged in to reply to this topic.

Lost Your Password?