Inherits System::Object.

Inherited by System::Xml::XmlAttribute, System::Xml::XmlCharacterData, System::Xml::XmlDeclaration, System::Xml::XmlDocument, System::Xml::XmlDocumentFragment, System::Xml::XmlDocumentType, System::Xml::XmlElement, and System::Xml::XmlProcessingInstruction.

Public Types

typedef SharedPtr< XmlNodePtr
 An alias for shared pointer to an instance of this class. More...
 
- Public Types inherited from System::Object
typedef SmartPtr< Objectptr
 Alias for smart pointer type. More...
 
typedef System::Details::SharedMembersType shared_members_type
 structure to keep list of shared pointers contained in object. More...
 

Public Member Functions

virtual ASPOSECPP_SHARED_API ~XmlNode ()
 Destructor. More...
 
virtual ASPOSECPP_SHARED_API XmlNodeType get_NodeType () const
 Returns the type of the XML node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API String get_Name () const =0
 Returns the qualified name of the XML node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API String get_Value () const
 Returns the value of the XML node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API String get_LocalName () const
 Returns the local name of the XML node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API String get_Prefix () const
 Returns the prefix of the XML node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API String get_NamespaceURI () const
 Returns the namespace URI of the XML node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API String get_InnerText () const
 Returns the concatenated values of the XML node represented by the current object and all its child nodes. More...
 
virtual ASPOSECPP_SHARED_API String get_InnerXml () const
 Returns the XML markup representing the child nodes of the XML node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API String get_OuterXml () const
 Returns the XML markup representing the XML node represented by the current object and all its the child nodes. More...
 
virtual ASPOSECPP_SHARED_API bool get_HasChildNodes () const
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr get_FirstChild () const
 Returns the first child of the node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr get_LastChild () const
 Returns the last child of the node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr get_NextSibling () const
 Returns the next sibling of the node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr get_PreviousSibling () const
 Returns the previous sibling of the node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr get_ParentNode () const
 Returns the parent node of the node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API SharedPtr< XmlDocumentget_OwnerDocument () const
 
virtual ASPOSECPP_SHARED_API SharedPtr< XmlAttributeCollectionget_Attributes ()
 
virtual ASPOSECPP_SHARED_API SharedPtr< XmlNodeListget_ChildNodes ()
 
virtual ASPOSECPP_SHARED_API void set_Value (String value)
 
virtual void set_Prefix (String)
 Sets the prefix of the XML node represented by the current object. More...
 
virtual ASPOSECPP_SHARED_API void set_InnerText (String value)
 
virtual ASPOSECPP_SHARED_API void set_InnerXml (String value)
 
virtual SharedPtr< XmlElementidx_get (String) const
 Returns a shared pointer to the newly constructed XmlElement object. More...
 
virtual SharedPtr< XmlElementoperator[] (String name) const
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr AppendChild (XmlNode::Ptr child)
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr PrependChild (XmlNode::Ptr new_child)
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr ReplaceChild (XmlNode::Ptr new_child, XmlNode::Ptr old_child)
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr InsertAfter (XmlNode::Ptr new_child, XmlNode::Ptr ref_child)
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr InsertBefore (XmlNode::Ptr new_child, XmlNode::Ptr ref_child)
 
virtual ASPOSECPP_SHARED_API void RemoveAll ()
 Removes all child nodes of the XML node reprsented by the current object. More...
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr RemoveChild (XmlNode::Ptr child)
 
virtual ASPOSECPP_SHARED_API String GetPrefixOfNamespace (const String &namespace_uri)
 
virtual ASPOSECPP_SHARED_API String GetNamespaceOfPrefix (const String &prefix)
 
virtual void WriteContentTo (SharedPtr< XmlWriter > writer)
 
virtual ASPOSECPP_SHARED_API void WriteTo (SharedPtr< XmlWriter > writer)=0
 
virtual ASPOSECPP_SHARED_API SharedPtr< XmlNodeListSelectNodes (String xPath)
 
virtual ASPOSECPP_SHARED_API SharedPtr< XmlNodeListSelectNodes (String xPath, SharedPtr< XmlNamespaceManager > nsMgr)
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr SelectSingleNode (String xPath)
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr SelectSingleNode (String xPath, SharedPtr< XmlNamespaceManager > nsMgr)
 
ASPOSECPP_SHARED_API SharedPtr< System::Collections::Generic::IEnumerator< XmlNode::Ptr > > GetEnumerator ()
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr CloneNode (bool deep)=0
 
XmlNode::Ptr Clone ()
 
xmlNode * native_node ()
 Returns a pointer to the underlying libxml2 xmlNode object. More...
 
- Public Member Functions inherited from System::Object
ASPOSECPP_SHARED_API Object ()
 Creates object. Initializes all internal data structures. More...
 
virtual ASPOSECPP_SHARED_API ~Object ()
 Destroys object. Frees all internal data structures. More...
 
ASPOSECPP_SHARED_API Object (Object const &x)
 Copy constructor. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
Objectoperator= (Object const &x)
 Assignment operator. Doesn't copy anything, really, just initializes new object and enables copy constructing subclasses. More...
 
ObjectSharedRefAdded ()
 Increments shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int SharedRefRemovedSafe ()
 Decrements and returns shared reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
int RemovedSharedRefs (int count)
 Decreases shared reference count by specified value. More...
 
Detail::SmartPtrCounter * WeakRefAdded ()
 Increments weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
void WeakRefRemoved ()
 Decrements weak reference count. Shouldn't be called directly; instead, use smart pointers or ThisProtector. More...
 
Detail::SmartPtrCounter * GetCounter ()
 Gets reference counter data structure associated with the object. More...
 
int SharedCount () const
 Gets current value of shared refernce counter. More...
 
ASPOSECPP_SHARED_API void Lock ()
 Implements C# lock() statement locking. Call directly or use LockContext sentry object. More...
 
ASPOSECPP_SHARED_API void Unlock ()
 Implements C# lock() statement unlocking. Call directly or use LockContext sentry object. More...
 
virtual ASPOSECPP_SHARED_API bool Equals (ptr obj)
 Compares objects using C# Object.Equals semantics. More...
 
virtual ASPOSECPP_SHARED_API int GetHashCode () const
 Analog of C# Object.GetHashCode() method. Enables hashing of custom objects. More...
 
virtual ASPOSECPP_SHARED_API String ToString () ASPOSE_CONST
 Analog of C# Object.ToString() method. Enables converting custom objects to string. More...
 
virtual ASPOSECPP_SHARED_API ptr MemberwiseClone () const
 Analog of C# Object.MemberwiseClone() method. Enables cloning custom types. More...
 
virtual ASPOSECPP_SHARED_API const TypeInfoGetType () const
 Gets actual type of object. Analog of C# System.Object.GetType() call. More...
 
virtual ASPOSECPP_SHARED_API bool Is (const TypeInfo &targetType) const
 Check if object represents an instance of type described by targetType. Analog of C# 'is' operator. More...
 
virtual ASPOSECPP_SHARED_API void SetTemplateWeakPtr (unsigned int argument)
 Set n'th template argument a weak pointer (rather than shared). Allows switching pointers in containers to weak mode. More...
 
template<>
bool Equals (float const &objA, float const &objB)
 
template<>
bool Equals (double const &objA, double const &objB)
 
template<>
bool ReferenceEquals (String const &str, std::nullptr_t)
 
template<>
bool ReferenceEquals (String const &str1, String const &str2)
 

Protected Types

enum  insert_where { insert_begin, insert_before, insert_after, insert_end }
 

Protected Member Functions

ASPOSECPP_SHARED_API XmlNode (xmlNode *node)
 
ASPOSECPP_SHARED_API XmlNode (xmlNode *node, const SharedPtr< XmlDocument > &owner)
 
ASPOSECPP_SHARED_API XmlNode (const SharedPtr< XmlDocument > &owner)
 
SharedPtr< XmlElementfind_child_xml_element_by_name (const String &name, const SharedPtr< XmlDocument > &owner_doc) const
 
uint64_t child_elements_count () const
 
bool can_be_append (XmlNodeType type) const
 
insert_where noralize_place (xmlNode *ref_child, insert_where place)
 
void insert_verified_child_node (const XmlNode::Ptr &child, xmlNode *ref_child, insert_where place)
 
void insert_document_fragment (const XmlNode::Ptr &fragment, xmlNode *ref_child, insert_where place)
 
void reassign_native (xmlNode *node)
 
xmlAttr * get_attribute_by_qname (const String &qname) const
 
xmlNs * find_ns (const std::string &prefix) const
 
ASPOSECPP_SHARED_API void set_Value (const String &text, bool riseEvent)
 

Static Protected Member Functions

static xmlNs * make_new_ns (xmlNodePtr parent, const std::string &prefix, const std::string &uri="")
 
static void parse_qname (const std::string &qname, std::string &prefix, std::string &local_name)
 
static int csharp_nodetype_to_libxml (XmlNodeType type)
 
static XmlNode::Ptr create_wrapper (xmlNode *node, const SharedPtr< XmlDocument > &owner, const std::shared_ptr< xmlDoc > &doc=nullptr)
 
static SharedPtr< XmlAttributecreate_wrapper_attr (xmlAttr *attr, const SharedPtr< XmlDocument > &owner)
 
static SharedPtr< XmlAttributecreate_wrapper_attr (xmlNs *ns, const SharedPtr< XmlDocument > &owner, const SharedPtr< XmlElement > &element)
 
static SharedPtr< XmlAttributecreate_wrapper_attr (const String &prefix, const String &local_name, const String &namespace_uri, const SharedPtr< XmlDocument > &owner)
 

Protected Attributes

std::shared_ptr< xmlDoc > m_doc
 
xmlNode * m_node
 Pointer to underlying libxml2 xmlNode object. More...
 
WeakPtr< XmlDocumentm_owner
 Weak poiter to the owning XML document. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from System::Object
static bool ReferenceEquals (ptr const &objA, ptr const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, T const &objB)
 Compares objects by reference. More...
 
template<typename T >
static std::enable_if<!IsSmartPtr< T >::value, bool >::type ReferenceEquals (T const &objA, std::nullptr_t)
 Reference-compares value type object with nullptr. More...
 
template<typename T1 , typename T2 >
static std::enable_if< IsSmartPtr< T1 >::value &&IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares reference type objects in C# style. More...
 
template<typename T1 , typename T2 >
static std::enable_if<!IsSmartPtr< T1 >::value &&!IsSmartPtr< T2 >::value, bool >::type Equals (T1 const &objA, T2 const &objB)
 Compares value type objects in C# style. More...
 
static const TypeInfoType ()
 Impleemnts C# typeof(System.Object) construct. More...
 

Detailed Description

Represents an XML node. Objects of this class should only be allocated using System::MakeObject() function. Never create instance of this type on stack or using operator new, as it will result in runtime errors and/or assertion faults. Always wrap this class into System::SmartPtr pointer and use this pointer to pass it to functions as argument.

Member Typedef Documentation

◆ Ptr

An alias for shared pointer to an instance of this class.

Member Enumeration Documentation

◆ insert_where

Specifies the position in the child nodes list where to insert a node during insertion operation.

Enumerator
insert_begin 

Insert before the first node.

insert_before 

Insert at the position prior to the position of the reference node.

insert_after 

Insert at the position next to the position of the reference node.

insert_end 

Insert after the last element.

Constructor & Destructor Documentation

◆ ~XmlNode()

virtual ASPOSECPP_SHARED_API System::Xml::XmlNode::~XmlNode ( )
virtual

Destructor.

◆ XmlNode() [1/3]

ASPOSECPP_SHARED_API System::Xml::XmlNode::XmlNode ( xmlNode *  node)
protected

Constructs an instance of XmlNode class that represents the specified XML node.

Parameters
nodeThe node to be represented by the object being constructed

◆ XmlNode() [2/3]

ASPOSECPP_SHARED_API System::Xml::XmlNode::XmlNode ( xmlNode *  node,
const SharedPtr< XmlDocument > &  owner 
)
protected

Constructs an instance of XmlNode class that represents the specified XML node and belongs to the specified owner XML document.

Parameters
nodeThe node to be represented by the object being constructed
ownerThe XML document to which the XML node represented by the object being constructed should belong.

◆ XmlNode() [3/3]

ASPOSECPP_SHARED_API System::Xml::XmlNode::XmlNode ( const SharedPtr< XmlDocument > &  owner)
protected

Constructs an instance of XmlNode class that belongs to the specified document. The underlying libxml2 xmlNode object is not created. This constructor is intended to be used by XmlDeclaration class only.

Parameters
ownerAn XmlDocument object representing the owner document of the node being constructed

Member Function Documentation

◆ AppendChild()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::AppendChild ( XmlNode::Ptr  child)
virtual

Adds the specified XML node at the end of the list of children of the XML node represented by the current object.

Parameters
childThe XML node to add
Returns
A shared pointer to the specified XmlNode object child

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlElement, and System::Xml::XmlDocumentFragment.

◆ can_be_append()

bool System::Xml::XmlNode::can_be_append ( XmlNodeType  type) const
protected

Determines if an XML node of the specified type can be added as a child node to the XML node represented by the current object.

Parameters
typeThe type to check
Returns
True if the XML node of type type can be a child node of the node represented by the current object, otherwise - false

◆ child_elements_count()

uint64_t System::Xml::XmlNode::child_elements_count ( ) const
protected

Returns the number of children of all levels of the XML node represented by the current object.

◆ Clone()

XmlNode::Ptr System::Xml::XmlNode::Clone ( )
inline

Returns a copy of the node represented by the current object. The subtree under the node is also copied. This method is equivallent to calling CloneNode(true).

◆ CloneNode()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::CloneNode ( bool  deep)
pure virtual

Returns a copy of the node represented by the current object.

Parameters
deepSpecifies whether to clone the subtree under the node represented by the current object (true) or only the node itself (false)
Returns
A shared pointer to an XmlNode object that is a copy of the current object

Implemented in System::Xml::XmlDocument, System::Xml::XmlElement, System::Xml::XmlAttribute, System::Xml::XmlDeclaration, System::Xml::XmlDocumentFragment, System::Xml::XmlCharacterData, System::Xml::XmlDocumentType, and System::Xml::XmlProcessingInstruction.

◆ create_wrapper()

static XmlNode::Ptr System::Xml::XmlNode::create_wrapper ( xmlNode *  node,
const SharedPtr< XmlDocument > &  owner,
const std::shared_ptr< xmlDoc > &  doc = nullptr 
)
staticprotected

Creates an instance of XmlNode class that represents the specified node and belongs to the specified document.

Parameters
nodeThe XML node to be represented by the XmlNode object being created
ownerThe XmlDocument object to which the created XmlNode object should belong
docThe xmlDoc object shared among all XmlNodes
Returns
A shared pointer to a newly created XmlNode object that represents node node and belongs to owner document

◆ create_wrapper_attr() [1/3]

static SharedPtr<XmlAttribute> System::Xml::XmlNode::create_wrapper_attr ( xmlAttr *  attr,
const SharedPtr< XmlDocument > &  owner 
)
staticprotected

Creates an instance of XmlAttribute class that represents the specified attribute and belongs to the specified document.

Parameters
attrThe XML attribute to be represented by the XmlAttribute object being created
ownerThe XmlDocument object to which the created XmlAttribute object should belong
Returns
A shared pointer to a newly created XmlAttribute object that represents attr attribute and belongs to owner document

◆ create_wrapper_attr() [2/3]

static SharedPtr<XmlAttribute> System::Xml::XmlNode::create_wrapper_attr ( xmlNs *  ns,
const SharedPtr< XmlDocument > &  owner,
const SharedPtr< XmlElement > &  element 
)
staticprotected

Creates an instance of XmlAttribute class that represents an xmlns attribute and belongs to the specified document.

Parameters
nsThe namespace that the attribute represented by the current object should declare
ownerThe XmlDocument object to which the created XmlAttribute object should belong
elementThe XmlElement object to which the created XmlAttribute object should belong
Returns
A shared pointer to a newly created XmlAttribute object that represents an xmlns attribute that declares a namespace ns and belongs to owner document

◆ create_wrapper_attr() [3/3]

static SharedPtr<XmlAttribute> System::Xml::XmlNode::create_wrapper_attr ( const String prefix,
const String local_name,
const String namespace_uri,
const SharedPtr< XmlDocument > &  owner 
)
staticprotected

Constructs an XmlAttribute object that represents a detached XML attribute belonging to the specified owner.

Parameters
prefixThe namespace prefix of the attribute
local_nameThe local name of the attribute
namespace_uriThe namespace URI associated with the attribute
ownerThe owner document of the attribute
Returns
A shared pointer to the created XmlAttribute object

◆ csharp_nodetype_to_libxml()

static int System::Xml::XmlNode::csharp_nodetype_to_libxml ( XmlNodeType  type)
staticprotected

Converts the specified XML node type represented as an XmlNodeType value to equivalent value defied by libxml2 library.

Parameters
typeAn XmlNodeType value to convert
Returns
A value representing a node type defined by libxml2 library equivalent to type value

◆ find_child_xml_element_by_name()

SharedPtr<XmlElement> System::Xml::XmlNode::find_child_xml_element_by_name ( const String name,
const SharedPtr< XmlDocument > &  owner_doc 
) const
protected

Looks up an XML element with the specified name which is a descandant of the specified XML document.

Parameters
nameThe qualified name of the XML element to find
owner_docThe XML document
Returns
A shared pointer to an XmlElement object representing the found XML element if the element has been found, otherwise - null-pointer

◆ find_ns()

xmlNs* System::Xml::XmlNode::find_ns ( const std::string &  prefix) const
protected

Returns a namespace associated with the specified prefix.

Parameters
prefixA namespace prefix
Returns
A pointer to a libxml2 xmlNs object representing a namespace associated with the specified prefix or NULL if such namespace has not been found.

◆ get_attribute_by_qname()

xmlAttr* System::Xml::XmlNode::get_attribute_by_qname ( const String qname) const
protected

Returns an attribute with the specified qualified name.

Parameters
qnameThe attribute's qualified name
Returns
A pointer to a libxml2 xmlAttr object representing an attribute with the specified name or NULL if the attribute has not been found

◆ get_Attributes()

virtual ASPOSECPP_SHARED_API SharedPtr<XmlAttributeCollection> System::Xml::XmlNode::get_Attributes ( )
virtual

Returns an XmlAttributeCollection object containing all attributes of the XML node represented by the current object.

Reimplemented in System::Xml::XmlElement.

◆ get_ChildNodes()

virtual ASPOSECPP_SHARED_API SharedPtr<XmlNodeList> System::Xml::XmlNode::get_ChildNodes ( )
virtual

Returns an XmlNodeList object containing all child nodes of the XML node represented by the current object.

◆ get_FirstChild()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::get_FirstChild ( ) const
virtual

Returns the first child of the node represented by the current object.

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_HasChildNodes()

virtual ASPOSECPP_SHARED_API bool System::Xml::XmlNode::get_HasChildNodes ( ) const
virtual

Determines if the XML node represented by the current object has child nodes.

Returns
True if the XML node represented by the current object has at least one child node, otherwise - false.

Reimplemented in System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_InnerText()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::get_InnerText ( ) const
virtual

Returns the concatenated values of the XML node represented by the current object and all its child nodes.

Reimplemented in System::Xml::XmlAttribute, System::Xml::XmlDeclaration, System::Xml::XmlProcessingInstruction, and System::Xml::XmlCDataSection.

◆ get_InnerXml()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::get_InnerXml ( ) const
virtual

Returns the XML markup representing the child nodes of the XML node represented by the current object.

Reimplemented in System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_LastChild()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::get_LastChild ( ) const
virtual

Returns the last child of the node represented by the current object.

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_LocalName()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::get_LocalName ( ) const
virtual

Returns the local name of the XML node represented by the current object.

Reimplemented in System::Xml::XmlElement, System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_Name()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::get_Name ( ) const
pure virtual

◆ get_NamespaceURI()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::get_NamespaceURI ( ) const
virtual

Returns the namespace URI of the XML node represented by the current object.

Reimplemented in System::Xml::XmlAttribute, System::Xml::XmlElement, and System::Xml::XmlDeclaration.

◆ get_NextSibling()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::get_NextSibling ( ) const
virtual

Returns the next sibling of the node represented by the current object.

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_NodeType()

virtual ASPOSECPP_SHARED_API XmlNodeType System::Xml::XmlNode::get_NodeType ( ) const
virtual

Returns the type of the XML node represented by the current object.

Reimplemented in System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_OuterXml()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::get_OuterXml ( ) const
virtual

Returns the XML markup representing the XML node represented by the current object and all its the child nodes.

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_OwnerDocument()

virtual ASPOSECPP_SHARED_API SharedPtr<XmlDocument> System::Xml::XmlNode::get_OwnerDocument ( ) const
virtual

Returns a shared pointer to an XmlDocument object representing an XML document node to which the node represented by the current object belongs.

Reimplemented in System::Xml::XmlDocument.

◆ get_ParentNode()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::get_ParentNode ( ) const
virtual

Returns the parent node of the node represented by the current object.

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_Prefix()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::get_Prefix ( ) const
virtual

Returns the prefix of the XML node represented by the current object.

Reimplemented in System::Xml::XmlAttribute, System::Xml::XmlElement, and System::Xml::XmlDeclaration.

◆ get_PreviousSibling()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::get_PreviousSibling ( ) const
virtual

Returns the previous sibling of the node represented by the current object.

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ get_Value()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::get_Value ( ) const
virtual

Returns the value of the XML node represented by the current object.

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlAttribute, System::Xml::XmlElement, and System::Xml::XmlDeclaration.

◆ GetEnumerator()

ASPOSECPP_SHARED_API SharedPtr<System::Collections::Generic::IEnumerator<XmlNode::Ptr> > System::Xml::XmlNode::GetEnumerator ( )

Returns an enumerator that points to the collection containing child nodes of the node represented by the current object.

◆ GetNamespaceOfPrefix()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::GetNamespaceOfPrefix ( const String prefix)
virtual

Looks up the closest xmlns declaration for the specified prefix that is in scope for the XML node represented by the current object and returns the namespace URI defined in that declaration.

Parameters
prefixThe prefix whose namespace URI to find
Returns
The namespace URI associated with the specified prefix

◆ GetPrefixOfNamespace()

virtual ASPOSECPP_SHARED_API String System::Xml::XmlNode::GetPrefixOfNamespace ( const String namespace_uri)
virtual

Looks up the closest xmlns declaration for the specified namespace URI that is in scope for the XML node represented by the current object and returns the prefix defined in that declaration.

Parameters
namespace_uriThe namespace URI whose prefix to find
Returns
The prefix associated with the specified namespace URI

◆ idx_get()

virtual SharedPtr<XmlElement> System::Xml::XmlNode::idx_get ( String  ) const
inlinevirtual

Returns a shared pointer to the newly constructed XmlElement object.

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlElement, and System::Xml::XmlAttribute.

◆ insert_document_fragment()

void System::Xml::XmlNode::insert_document_fragment ( const XmlNode::Ptr fragment,
xmlNode *  ref_child,
insert_where  place 
)
protected

Inserts the nodes of the specified document fragment in the list of children of the node represented by the current object at the specified position.

Parameters
fragmentThe document fragment to insert
ref_childThe reference child node; place specifies the insertion position as relative to the position of ref_child child node
placeSpecified the insertion position relative to the position of ref_child

◆ insert_verified_child_node()

void System::Xml::XmlNode::insert_verified_child_node ( const XmlNode::Ptr child,
xmlNode *  ref_child,
insert_where  place 
)
protected

Inserts the specified node in the list of children of the node represented by the current object at the specified position.

Parameters
childA node to insert
ref_childThe reference child node; place specifies the insertion position as relative to the position of ref_child child node
placeSpecified the insertion position relative to the position of ref_child

◆ InsertAfter()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::InsertAfter ( XmlNode::Ptr  new_child,
XmlNode::Ptr  ref_child 
)
virtual

Adds the specified XML node to the list of children of the XML node represented by the current object at the position next to the position of the specified reference child node.

Parameters
new_childThe XML node to add
ref_childThe reference node indicating the position in the list of children next to which node should be inserted
Returns
A shared pointer to the specified XmlNode object child

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlElement, and System::Xml::XmlDocumentFragment.

◆ InsertBefore()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::InsertBefore ( XmlNode::Ptr  new_child,
XmlNode::Ptr  ref_child 
)
virtual

Adds the specified XML node to the list of children of the XML document represented by the current object at the position prior to the position of the specified reference child node.

Parameters
new_childThe XML node to add
ref_childThe reference node indicating the position in the list of children next to which node should be inserted
Returns
A shared pointer to the specified XmlNode object child

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlElement, and System::Xml::XmlDocumentFragment.

◆ make_new_ns()

static xmlNs* System::Xml::XmlNode::make_new_ns ( xmlNodePtr  parent,
const std::string &  prefix,
const std::string &  uri = "" 
)
staticprotected

Creates a new namespace.

Parameters
parentThe element that carries the namespace
prefixThe prefix to be associated with the namespace; empty string if a default namespace is to be created
uriThe URI for the namespace
Returns
A pointer to libxml2 xmlNs object representing the created namespace or NULL in case of error

◆ native_node()

xmlNode* System::Xml::XmlNode::native_node ( )
inline

Returns a pointer to the underlying libxml2 xmlNode object.

◆ noralize_place()

insert_where System::Xml::XmlNode::noralize_place ( xmlNode *  ref_child,
insert_where  place 
)
protected

Normalizes the indicator of the position where the node is to be inserted by making it consistent with the reference child value and presence of nodes in the list of children of the current node.

Parameters
ref_childThe reference node relative to which the insertion position is specified
placeThe insertion position relative to the position of reference node
Returns
The normalized insrtion position

◆ operator[]()

virtual SharedPtr<XmlElement> System::Xml::XmlNode::operator[] ( String  name) const
inlinevirtual

Returns a shared pointer to the XmlElement object representing the child element of the XML node represented by the current object with the specified qualified name.

Parameters
nameThe qualified name of the element to return
Returns
A shared pointer to the XmlElement object representing the child element of the XML node represented by the current object with name name.

◆ parse_qname()

static void System::Xml::XmlNode::parse_qname ( const std::string &  qname,
std::string &  prefix,
std::string &  local_name 
)
staticprotected

Parses the XML node's qualified name by breaking it into a prefix and a local name.

Parameters
qnameThe qualfied name to parse
prefixOutput argument; the prefix part of the specified qualified name is assigned to it
local_nameOutput argument; the local name part of the specified qualified name is assigned to it

◆ PrependChild()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::PrependChild ( XmlNode::Ptr  new_child)
virtual

Adds the specified XML node at the beginning of the list of children of the XML node represented by the current object.

Parameters
new_childThe XML node to add
Returns
A shared pointer to the specified XmlNode object child

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlElement, and System::Xml::XmlDocumentFragment.

◆ reassign_native()

void System::Xml::XmlNode::reassign_native ( xmlNode *  node)
protected

Replaces the node reprsented by the current object with the specified one.

Parameters
nodeThe new node to be represented by the current object

◆ RemoveAll()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlNode::RemoveAll ( )
virtual

Removes all child nodes of the XML node reprsented by the current object.

Reimplemented in System::Xml::XmlAttribute.

◆ RemoveChild()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::RemoveChild ( XmlNode::Ptr  child)
virtual

Removes the specified child node of the XML node represented by the current object.

Parameters
childThe node to remove
Returns
The reoved node

Reimplemented in System::Xml::XmlDocument, and System::Xml::XmlAttribute.

◆ ReplaceChild()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::ReplaceChild ( XmlNode::Ptr  new_child,
XmlNode::Ptr  old_child 
)
virtual

Replaces the specified the specified child node of the node reprsented by the current object with another one.

Parameters
old_childThe node to replace
new_childThe node to replace old_child node with
Returns
The replaced node

◆ SelectNodes() [1/2]

virtual ASPOSECPP_SHARED_API SharedPtr<XmlNodeList> System::Xml::XmlNode::SelectNodes ( String  xPath)
virtual

Returns a list of XML nodes that match the specfied XPath expression.

Parameters
xPathThe XPath expression
Returns
The list of XmlNode objects representing XML nodes that match xpath XPath expression

Reimplemented in System::Xml::XmlDocument.

◆ SelectNodes() [2/2]

virtual ASPOSECPP_SHARED_API SharedPtr<XmlNodeList> System::Xml::XmlNode::SelectNodes ( String  xPath,
SharedPtr< XmlNamespaceManager nsMgr 
)
virtual

Returns a list of XML nodes that match the specfied XPath expression; any prefixes encountered in xpath expression are resolved using the specified namespace manager.

Parameters
xPathThe XPath expression
nsMgrThe XmlNamespaceManager object used to resolve prefixes found in xpath expression
Returns
The list of XmlNode objects representing XML nodes that match xpath XPath expression

Reimplemented in System::Xml::XmlDocument.

◆ SelectSingleNode() [1/2]

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::SelectSingleNode ( String  xPath)
virtual

Returns the first XML node that match the specfied XPath expression.

Parameters
xPathThe XPath expression
Returns
An XmlNode object representing the first XML node that matched xpath XPath expression

◆ SelectSingleNode() [2/2]

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlNode::SelectSingleNode ( String  xPath,
SharedPtr< XmlNamespaceManager nsMgr 
)
virtual

Returns the first XML node that match the specfied XPath expression; any prefixes encountered in xpath expression are resolved using the specified namespace manager.

Parameters
xPathThe XPath expression
nsMgrThe XmlNamespaceManager object used to resolve prefixes found in xpath expression
Returns
An XmlNode object representing the first XML node that matched xpath XPath expression

Reimplemented in System::Xml::XmlDocument.

◆ set_InnerText()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlNode::set_InnerText ( String  value)
virtual

Sets the XML node's inner text by replacing all the child nodes (if any) with the contents of the given string.

Parameters
valueThe inner text to set; all XML markup encountered in this string is escaped

Reimplemented in System::Xml::XmlDocument, System::Xml::XmlAttribute, and System::Xml::XmlCDataSection.

◆ set_InnerXml()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlNode::set_InnerXml ( String  value)
virtual

Replaces the XML node's inner XML markup with the contents of the specified string.

Parameters
valueThe XML markup to set

Reimplemented in System::Xml::XmlAttribute.

◆ set_Prefix()

virtual void System::Xml::XmlNode::set_Prefix ( String  )
inlinevirtual

Sets the prefix of the XML node represented by the current object.

Reimplemented in System::Xml::XmlAttribute, and System::Xml::XmlElement.

◆ set_Value() [1/2]

virtual ASPOSECPP_SHARED_API void System::Xml::XmlNode::set_Value ( String  value)
virtual

Sets the value of the node represented by the current object.

Parameters
valueThe value to set

Reimplemented in System::Xml::XmlAttribute, and System::Xml::XmlDeclaration.

◆ set_Value() [2/2]

ASPOSECPP_SHARED_API void System::Xml::XmlNode::set_Value ( const String text,
bool  riseEvent 
)
protected

Sets the value of the XML node represented by the current object and triggers corresponding events.

Parameters
textThe value to set
riseEventSpecifies whether OnNodeChanging and OnNodeChanged events should be triggered

◆ WriteContentTo()

virtual void System::Xml::XmlNode::WriteContentTo ( SharedPtr< XmlWriter writer)
inlinevirtual

Saves all children of the XML node represented by the current object to the specified XmlWriter object.

Parameters
writerA XmlWriter object to save the chlid nodes to

Reimplemented in System::Xml::XmlElement, System::Xml::XmlDocument, System::Xml::XmlAttribute, System::Xml::XmlDeclaration, System::Xml::XmlDocumentFragment, and System::Xml::XmlCDataSection.

◆ WriteTo()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlNode::WriteTo ( SharedPtr< XmlWriter writer)
pure virtual

Member Data Documentation

◆ m_doc

std::shared_ptr<xmlDoc> System::Xml::XmlNode::m_doc
protected

XML document to which the XML node represented by the current object belongs.

◆ m_node

xmlNode* System::Xml::XmlNode::m_node
protected

Pointer to underlying libxml2 xmlNode object.

◆ m_owner

WeakPtr<XmlDocument> System::Xml::XmlNode::m_owner
protected

Weak poiter to the owning XML document.