xmlElementComponent
The xmlElementComponent is a subsidiary component to the xmlDocumentComponent. It is used to manipulate nodes within an XML document. Note you must add the xmlDocumentComponent and load a document before you can use the xmlElementComponent.
Properties
Property |
Description |
Type |
ChildNodes |
Gets a list of child nodes of the specified element. |
IList xmlElementComponent |
Document |
Gets the xmlDocumentComponent to which this element belongs. |
xmlDocumentComponent |
HasChildNodes |
Gets a True or False value that indicates whether this element as any child nodes. |
Boolean |
InnerText |
Gets or sets the concatenated values of the element and all its child nodes. |
String |
InnerXML |
Gets or sets the markup representing only the child nodes of this element. |
String |
LocalName |
Gets the local name of the element. |
String |
NodeName |
Gets the qualified name of the node. |
String |
OuterXML |
Gets the markup representing this element and all its child nodes. |
String |
Prefix |
Gets the namespace prefix of this element. |
String |
Methods
Method |
Description |
Parameters |
Return Type |
AppendChild |
Adds the specified node to the end of the list of child nodes of this element. This method is not valid for strongly typed documents. |
String XML |
Void |
AppendChild |
Adds the specified element to the end of the list of child nodes of this element. This method is not valid for strongly typed documents. |
xmlElementComponent element |
Void |
GetAttribute |
Gets the value of an attribute on the root element. |
String attribute |
String |
GetDocument |
Gets XmlDocumentComponent for document. Returns true if document output is not null. |
None |
XmlDocumentComponent, Boolean |
GetFirstChild |
Gets first child node of the element. Returns true if element output is not null. |
None |
XmlElementComponent element, Boolean |
GetLastChild |
Gets the last child of the element. Returns true if element output is not null. |
None |
xmlElementComponent, Boolean |
GetNextSibling |
Gets the next sibling of the element. Returns true if element output is not null. |
None |
xmlElementComponent, Boolean |
GetParentNode |
Gets the parent node of the element. Returns true if element output is not null. |
None |
xmlElementComponent, Boolean |
GetPreviousSibling |
Gets the previous sibling of the element. Returns true if element output is not null. |
None |
xmlElementComponent, Boolean |
Insert |
Inserts XML at the given index. Returns True if the insert was successful. This method is not valid for strongly typed documents. |
Int32 index, String XML |
Boolean |
Insert |
Inserts element at the given index. Returns True if the insert was successful. This method is not valid for strongly typed documents. |
Int32 index, xmlElementComponent element |
Boolean |
InsertAfter |
Inserts xml after the node selected by the XPath. Returns True if the insert was successful. This method is not valid for strongly typed documents. |
String XPath, string XML |
Boolean |
InsertAfter |
Inserts an element after the node selected by the XPath. Returns True if the insert was successful. This method is not valid for strongly typed documents. |
String XPath, xmlElementComponent element |
Boolean |
InsertBefore |
Inserts XML before the node selected by the XPath. Returns True if the insert was successful. This method is not valid for strongly typed documents. |
String XPath, String XML |
Boolean |
InsertBefore |
Inserts an element before the node selected by the XPath. Returns True if the insert was successful. This method is not valid for strongly typed documents. |
String XPath, xmlElementComponent element |
Boolean |
PrependChild |
Adds XML to the beginning of the list of child nodes for this element. This method is not valid for strongly typed documents. |
String XML |
Void |
PrependChild |
Adds element to the beginning of the list of child nodes for this node. This method is not valid for strongly typed documents. |
xmlElementComponent element |
Void |
Remove |
Removes the element at the given index, if applicable. For elements which do not support indexing, the index value is ignored. This method is not valid for strongly typed documents. |
Int32 index |
Void |
RemoveNodes |
Removes all nodes selected by the XPath. Returns True if the removal was successful. This method is not valid for strongly typed documents. |
String XPath |
Boolean |
RemoveSingleNode |
Removes the first node selected by the XPath. Returns True if the removal was successful. This method is not valid for strongly typed documents. |
String XPath |
Boolean |
Replace |
Replaces the node selected by the XPath with the given XML. Returns True if the replace was successful. This method is not valid for strongly typed documents. |
String XPath, String XML |
Boolean |
Replace |
Replaces the node selected by the XPath with element. Returns True if the replace was successful. This method is not valid for strongly typed documents. |
String XPath, xmlElementComponent element |
Boolean |
SelectNodes |
Returns list of nodes as xmlElementComponent objects matching the XPath. |
String XPath |
IList xmlElementComponent |
SelectSingleNode |
Selects the first element matching the XPath as an xmlElementComponent object. |
String XPath |
xmlElementComponent |
ToString |
Returns OuterXML value of the element. |
None |
String |
Methods for generated types from strongly typed documents
This table lists the additional methods added on all generated types from strongly typed documents. These types are descendants of the xmlElementComponent. All references to the descendent types are indicated in the table below as [type] and methods which expose argument lists composed of constituent properties of the descendent type are indicated as either [type list] or [type list without attributes].
Method |
Description |
Parameters |
Return Type |
AppendChild[type] |
Appends [type] as new child node. |
[type] |
Void |
AppendChild[type] |
Appends [type] as new child node. |
[type list] |
Void |
AppendChild[type] |
Appends [type] as new child node. |
[type list without collections] |
Void |
Insert[type] |
Inserts [type] at given index. Returns True if the insert was successful. |
Int32 index, [type] |
Boolean |
Insert[type] |
Inserts [type] at given index. Returns True if the insert was successful. |
Int32 index, [type list] |
Boolean |
Insert[type] |
Inserts [type] at given index. Returns True if the insert was successful. |
Int32 index, [type list without collections] |
Boolean |
PrependChild[type] |
Prepends [type] as new child node. |
[type] |
Void |
PrependChild[type] |
Prepends [type] as new child node. |
[type list] |
Void |
PrependChild[type] |
Prepends [type] as new child node. |
[type list without collections] |
Void |
Remove[type] |
Removes [type] at given index. |
Int32 index |
Void |
Remove[type] |
Removes nodes specified by XPath. Returns True if the removal was successful. |
String XPath |
Boolean |
Replace[type] |
Replaces nodes specified by index with [type]. Returns True if the replacement was successful. |
Int32 index, [type] |
Boolean |
Replace[type] |
Replaces nodes specified by index with [type]. Returns True if the replacement was successful. |
Int32 index, [type list] |
Boolean |
Replace[type] |
Replaces nodes specified by index with [type]. Returns True if the replacement was successful. |
Int32 index, [type list without collections] |
Boolean |
Select[type]List |
Select nodes by XPath and returns as a list of [type]. |
String XPath |
IList<[type]> |
SelectSingle[type] |
Selects first node matching XPath and returns as [type]. |
String XPath |
[type] |
Note: Each property of a type is exposed as properties within Studio's Designer. Some properties will be collection types which contain collections of types that inherit from the xmlElementComponent. For these special collection types, you can use methods which are inherited from System.Collections.CollectionBase for direct manipulation of the collection properties, and these manipulations are reflected in the underlying XML document content. These methods available from the System.Collections.CollectionBase are available.
Method |
Description |
Parameters |
Return Type |
Add |
Adds [type] to end of collection. |
[type] |
Void |
Clear |
Clears collection, removing all nodes. |
None |
Void |
GetItem |
Returns [type] at given index. |
Int32 index |
[type] |
Insert |
Inserts [type] at given index in collection. |
Int32 index, [type] |
Void |
Remove |
Removes [type] from collection. |
[type] |
Void |
RemoveAt |
Removes [type] at given index from collection. |
Int32 index |
Void |
SetItem |
Sets [type] at given index. |
Int32 index, [type] |
Void |
Related information
Using the xmlDocumentComponent
xmlDocumentComponent with Schema
Using the xmlDocumentComponent with Schema
Privacy | Trademarks | Terms of Use | Feedback
Updated: 01 July 2024
© 2016 - 2024 Pegasystems Inc. Cambridge, MA All rights reserved.