從 XML 文件移除節點、內容和值Removing Nodes, Content, and Values from an XML Document

一旦 XML 文件物件模型 (DOM) 在記憶體中,即可從樹狀目錄移除節點,或從特定節點型別移除內容及值。Once an XML Document Object Model (DOM) is in memory, you can remove nodes from the tree, or remove content and values from certain node types. 如需如何從文件移除分葉節點或整個節點樹狀子目錄的詳細資訊,請參閱從 DOM 移除節點For information on how to remove a leaf node or entire node subtree from a document, see Removing Nodes from the DOM. 如需如何在項目上移除屬性的詳細資訊,請參閱移除 DOM 中項目節點的屬性For information on how to remove attributes on an element, see Removing Attributes from an Element Node in the DOM. 如需移除節點內容但在樹狀目錄中保留節點的詳細資訊,請參閱移除 DOM 中的節點內容For information on removing content of a node but leaving the node in the tree, see Removing Node Content in the DOM.

另請參閱See also