Adopt Node in C#

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nelsonbrodyk
    New Member
    • Mar 2008
    • 81

    Adopt Node in C#

    Hey All,
    I am wondering if C# supports AdoptNode at all?
    So far, I only see that XmlDocument supports ImportNode, which ends up returning a copy of the element. Instead, I want to import the actual object without making a copy.

    Here is an example of what I am trying to do:

    public Ident CreateIdent() {
    //need to create a new Ident
    Ident ident = new Ident();
    ident.SetXml() //there is more to this, but note that the ident object contains xml.
    //add the ident to the document, and return the ident
    //Not sure how to do this. But in java it's something like:
    XmlElement Idents = RunXPath("Ident s");
    idents.AdoptNod e(ident.Xml);
    return ident;
    }

    otherwise, it seems you have to use import, which returns you another node, then I would have to create a new Ident based off that node, and return that. Seems like a lot of extra overhead.

    Also, does C# support Dom Level 3, because that is what has the specification for AdoptNode I believe.

    Anyway, any information is much appreciated.

    Thanks,
    Nelson
  • nelsonbrodyk
    New Member
    • Mar 2008
    • 81

    #2
    Anyone have any ideas?

    Thanks.

    Comment

    Working...