Inherits System::Xml::XmlNode.

Public Types

typedef SharedPtr< XmlDocumentPtr
 An alias for shared pointer to an instance of this class. More...
 
- Public Types inherited from System::Xml::XmlNode
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

ASPOSECPP_SHARED_API XmlDocument ()
 Default constructor. Constructs a new instance of XmlDocument class. More...
 
ASPOSECPP_SHARED_API XmlDocument (xmlDoc *native)
 
ASPOSECPP_SHARED_API XmlDocument (const XmlNameTable::Ptr &nameTable)
 
ASPOSECPP_SHARED_API void Load (const String &filename)
 
ASPOSECPP_SHARED_API void Load (const SharedPtr< System::IO::Stream > &stream)
 
ASPOSECPP_SHARED_API void Load (const SharedPtr< System::IO::TextReader > &reader)
 
ASPOSECPP_SHARED_API void Load (const SharedPtr< XmlReader > &reader)
 
ASPOSECPP_SHARED_API void LoadXml (const String &xml)
 
ASPOSECPP_SHARED_API void Save (const String &filename) const
 
ASPOSECPP_SHARED_API void Save (const SharedPtr< System::IO::Stream > &stream) const
 
ASPOSECPP_SHARED_API void Save (const SharedPtr< System::IO::TextWriter > &writer) const
 
ASPOSECPP_SHARED_API void Save (const SharedPtr< XmlWriter > &writer) const
 
ASPOSECPP_SHARED_API String get_BaseURI () const override
 
String get_Name () const override
 Returns the name of the node represented by the current object. More...
 
String get_Value () const override
 
ASPOSECPP_SHARED_API String get_OuterXml () const override
 Returns the XML markup of the XML node represented by the current object and all its child nodes. More...
 
ASPOSECPP_SHARED_API XmlNode::Ptr get_FirstChild () const override
 Returns the first child of the node represented by the current object. More...
 
ASPOSECPP_SHARED_API XmlNode::Ptr get_LastChild () const override
 Returns the last child of the node represented by the current object. More...
 
ASPOSECPP_SHARED_API XmlNode::Ptr get_NextSibling () const override
 
ASPOSECPP_SHARED_API XmlNode::Ptr get_PreviousSibling () const override
 
ASPOSECPP_SHARED_API XmlNode::Ptr get_ParentNode () const override
 
ASPOSECPP_SHARED_API SharedPtr< XmlDocumentget_OwnerDocument () const override
 
ASPOSECPP_SHARED_API XmlElement::Ptr get_DocumentElement ()
 Returns the root XmlElement of the XML document node represented by the current object. More...
 
XmlNameTable::Ptr get_NameTable ()
 Returns the XmlNameTable object associated with the current object. More...
 
bool get_PreserveWhitespace () const
 Returns a value indicating whether to preserve insignificant white spaces in XML content. More...
 
ASPOSECPP_SHARED_API XmlDocumentType::Ptr get_DocumentType () const
 Gets the node containing the DOCTYPE declaration. More...
 
ASPOSECPP_SHARED_API void set_InnerText (String text) override
 
ASPOSECPP_SHARED_API void set_PreserveWhitespace (bool value)
 Sets a value indicating whether to preserve insignificant white spaces in XML content. More...
 
ASPOSECPP_SHARED_API XmlElement::Ptr idx_get (String name) const override
 
virtual ASPOSECPP_SHARED_API void WriteContentTo (SharedPtr< XmlWriter > writer) override
 
virtual ASPOSECPP_SHARED_API void WriteTo (SharedPtr< XmlWriter > writer) override
 
ASPOSECPP_SHARED_API SharedPtr< XmlAttributeCreateAttribute (const String &name)
 
ASPOSECPP_SHARED_API SharedPtr< XmlAttributeCreateAttribute (const String &qualifiedName, const String &namespaceURI)
 
ASPOSECPP_SHARED_API SharedPtr< XmlAttributeCreateAttribute (const String &prefix, const String &localName, const String &namespaceURI)
 
ASPOSECPP_SHARED_API SharedPtr< XmlNodeCreateNode (XmlNodeType type, const String &qname, const String &namespaceURI=u"")
 
ASPOSECPP_SHARED_API SharedPtr< XmlElementCreateElement (const String &qname)
 
ASPOSECPP_SHARED_API SharedPtr< XmlElementCreateElement (const String &qualifiedName, const String &namespaceURI)
 
ASPOSECPP_SHARED_API SharedPtr< XmlElementCreateElement (const String &prefix, const String &localName, const String &namespaceURI)
 
ASPOSECPP_SHARED_API SharedPtr< XmlTextCreateTextNode (const String &text)
 
ASPOSECPP_SHARED_API SharedPtr< XmlCommentCreateComment (const String &text)
 
ASPOSECPP_SHARED_API SharedPtr< XmlDeclarationCreateXmlDeclaration (const String &version, const String &encoding=u"", const String &standalone=u"")
 
ASPOSECPP_SHARED_API SharedPtr< XmlProcessingInstructionCreateProcessingInstruction (const String &target, const String &data)
 
ASPOSECPP_SHARED_API SharedPtr< XmlCDataSectionCreateCDataSection (const String &data)
 
ASPOSECPP_SHARED_API SharedPtr< XmlDocumentFragmentCreateDocumentFragment ()
 
System::SharedPtr< XmlSignificantWhitespace > CreateSignificantWhitespace (String text)
 
System::SharedPtr< XmlWhitespace > CreateWhitespace (String text)
 
System::SharedPtr< XmlAttributeCreateDefaultAttribute (String prefix, String localName, String namespaceURI)
 
ASPOSECPP_SHARED_API SharedPtr< XmlNodeImportNode (const SharedPtr< XmlNode > &node, bool deep)
 
ASPOSECPP_SHARED_API XmlNode::Ptr AppendChild (XmlNode::Ptr child) override
 
ASPOSECPP_SHARED_API XmlNode::Ptr PrependChild (XmlNode::Ptr child) override
 
ASPOSECPP_SHARED_API XmlNode::Ptr InsertBefore (XmlNode::Ptr child, XmlNode::Ptr ref_child) override
 
ASPOSECPP_SHARED_API XmlNode::Ptr InsertAfter (XmlNode::Ptr child, XmlNode::Ptr ref_child) override
 
ASPOSECPP_SHARED_API XmlNode::Ptr RemoveChild (XmlNode::Ptr child) override
 
SharedPtr< XmlNodeListSelectNodes (String xpath) override
 
SharedPtr< XmlNodeListSelectNodes (String xpath, SharedPtr< XmlNamespaceManager > nsmgr) override
 
SharedPtr< XmlNodeSelectSingleNode (String xpath, SharedPtr< XmlNamespaceManager > nsmgr=nullptr) override
 
ASPOSECPP_SHARED_API SharedPtr< XmlNodeListGetElementsByTagName (const String &name)
 
ASPOSECPP_SHARED_API SharedPtr< XmlNodeListGetElementsByTagName (const String &localName, const String &namespaceURI)
 
ASPOSECPP_SHARED_API SharedPtr< XmlElementGetElementById (const String &elementId)
 
ASPOSECPP_SHARED_API SharedPtr< XPath::XPathNavigatorCreateNavigator () override
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr CloneNode (bool deep) override
 
xmlDoc * native_doc () const
 Retirns a pointer to the underlying xmlDoc object. More...
 
ASPOSECPP_SHARED_API void set_XmlResolver (const SharedPtr< XmlResolver > &value)
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr ReadNode (const SharedPtr< XmlReader > reader)
 
void SetBaseURI (const String &base_uri)
 
- Public Member Functions inherited from System::Xml::XmlNode
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_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 bool get_HasChildNodes () 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_InnerXml (String value)
 
virtual SharedPtr< XmlElementoperator[] (String name) const
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr ReplaceChild (XmlNode::Ptr new_child, XmlNode::Ptr old_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 String GetPrefixOfNamespace (const String &namespace_uri)
 
virtual ASPOSECPP_SHARED_API String GetNamespaceOfPrefix (const String &prefix)
 
virtual ASPOSECPP_SHARED_API XmlNode::Ptr SelectSingleNode (String xPath)
 
ASPOSECPP_SHARED_API SharedPtr< System::Collections::Generic::IEnumerator< XmlNode::Ptr > > GetEnumerator ()
 
XmlNode::Ptr Clone ()
 
xmlNode * native_node ()
 Returns a pointer to the underlying libxml2 xmlNode object. More...
 
virtual ASPOSECPP_SHARED_API void Normalize ()
 
- 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 () 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)
 

Public Attributes

XmlNodeChangedEventSignal NodeInserting
 
XmlNodeChangedEventSignal NodeInserted
 
XmlNodeChangedEventSignal NodeRemoving
 
XmlNodeChangedEventSignal NodeRemoved
 
XmlNodeChangedEventSignal NodeChanging
 
XmlNodeChangedEventSignal NodeChanged
 

Protected Member Functions

ASPOSECPP_SHARED_API ~XmlDocument () override
 Destructor. More...
 
ASPOSECPP_SHARED_API void onNodeInserting (const XmlNode::Ptr &node, const XmlNode::Ptr &newParent)
 
ASPOSECPP_SHARED_API void onNodeInserted (const XmlNode::Ptr &node, const XmlNode::Ptr &newParent)
 
ASPOSECPP_SHARED_API void onNodeRemoving (const XmlNode::Ptr &node, const XmlNode::Ptr &oldParent)
 
ASPOSECPP_SHARED_API void onNodeRemoved (const XmlNode::Ptr &node, const XmlNode::Ptr &oldParent)
 
ASPOSECPP_SHARED_API void onNodeChanging (const XmlNode::Ptr &node, const XmlNode::Ptr &parent, const String &oldValue, const String &newValue)
 
ASPOSECPP_SHARED_API void onNodeChanged (const XmlNode::Ptr &node, const XmlNode::Ptr &parent, const String &oldValue, const String &newValue)
 
ASPOSECPP_SHARED_API SharedPtr< XmlAttributeCreateAttributeWithValue (const String &qname, const String &value)
 
- Protected Member Functions inherited from System::Xml::XmlNode
ASPOSECPP_SHARED_API ~XmlNode () override
 Destructor. More...
 
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)
 

Protected Attributes

NameTable::Ptr m_nameTable
 The nametable used by the current object. More...
 
XmlDeclaration::Ptr m_xmlDeclarationNode
 XML declaration node of the XML document represented by the current object. More...
 
bool m_preserveWhitespace
 The flag indicating whether to preserve insignificant white spaces. More...
 
- Protected Attributes inherited from System::Xml::XmlNode
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...
 
- Protected Types inherited from System::Xml::XmlNode
enum  insert_where { insert_begin, insert_before, insert_after, insert_end }
 
- Static Protected Member Functions inherited from System::Xml::XmlNode
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)
 

Detailed Description

Represents an XML document. 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.

Constructor & Destructor Documentation

◆ XmlDocument() [1/3]

ASPOSECPP_SHARED_API System::Xml::XmlDocument::XmlDocument ( )

Default constructor. Constructs a new instance of XmlDocument class.

◆ XmlDocument() [2/3]

ASPOSECPP_SHARED_API System::Xml::XmlDocument::XmlDocument ( xmlDoc *  native)

Constructs a new instance of XmlDocument class that represents the specified XML document.

Parameters
nativeAn instance of xmlDoc to be represented by the object being constructed

◆ XmlDocument() [3/3]

ASPOSECPP_SHARED_API System::Xml::XmlDocument::XmlDocument ( const XmlNameTable::Ptr nameTable)

Constructs a new instance of XmlDocument class that uses the specified

Parameters
nameTableThe name table to be associated with the object being constructed

◆ ~XmlDocument()

ASPOSECPP_SHARED_API System::Xml::XmlDocument::~XmlDocument ( )
overrideprotected

Destructor.

Member Function Documentation

◆ AppendChild()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::AppendChild ( XmlNode::Ptr  child)
overridevirtual

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

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

Reimplemented from System::Xml::XmlNode.

◆ CloneNode()

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

NOT IMPLEMENTED.

Exceptions
NotImplementedExceptionAlways

Implements System::Xml::XmlNode.

◆ CreateAttribute() [1/3]

ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> System::Xml::XmlDocument::CreateAttribute ( const String name)

Creates an attribute with the specified name.

Parameters
nameThe attribute's qualified name
Returns
A shared pointer to the created XmlAttribute object

◆ CreateAttribute() [2/3]

ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> System::Xml::XmlDocument::CreateAttribute ( const String qualifiedName,
const String namespaceURI 
)

Creates an attribute with the specified qualified name and namespace URI.

Parameters
qualifiedNameThe attribute's qualified name
namespaceURIThe attribute's namespace URI
Returns
A shared pointer to the created XmlAttribute object

◆ CreateAttribute() [3/3]

ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> System::Xml::XmlDocument::CreateAttribute ( const String prefix,
const String localName,
const String namespaceURI 
)

Creates an attribute with the specified prefix, local name and namespace URI.

Parameters
prefixThe attribute's prefix
localNameThe attribute's local name
namespaceURIThe attribute's namespace URI
Returns
A shared pointer to the created XmlAttribute object

◆ CreateAttributeWithValue()

ASPOSECPP_SHARED_API SharedPtr<XmlAttribute> System::Xml::XmlDocument::CreateAttributeWithValue ( const String qname,
const String value 
)
protected

Creates an XML attribute with the specified qualified name and value.

Parameters
qnameThe attribute's qualified name
valueThe attribute's value
Returns
A shared pointer to the created XmlAttribute object

◆ CreateCDataSection()

ASPOSECPP_SHARED_API SharedPtr<XmlCDataSection> System::Xml::XmlDocument::CreateCDataSection ( const String data)

Creates an XmlCDataSection object representing an XML CDATA section node with the specified content.

Parameters
dataThe content of the XML CDATA section node
Returns
A shared pointer to the created XmlCDataSection object

◆ CreateComment()

ASPOSECPP_SHARED_API SharedPtr<XmlComment> System::Xml::XmlDocument::CreateComment ( const String text)

Creates an XmlComment object representing an XML comment node with the specified content.

Parameters
textThe content of the XML comment node
Returns
A shared pointer to the created XmlComment object

◆ CreateDefaultAttribute()

System::SharedPtr<XmlAttribute> System::Xml::XmlDocument::CreateDefaultAttribute ( String  prefix,
String  localName,
String  namespaceURI 
)

Creates attribute with default value.

Parameters
prefixAttribute prefix.
localNameAttribute name.
namespaceURIAttribute namespace URI.
Returns
A shared pointer to the created object.

◆ CreateDocumentFragment()

ASPOSECPP_SHARED_API SharedPtr<XmlDocumentFragment> System::Xml::XmlDocument::CreateDocumentFragment ( )

Creates an XmlDocumentFragment object.

Returns
A shared pointer to the created XmlDocumentFragment object

◆ CreateElement() [1/3]

ASPOSECPP_SHARED_API SharedPtr<XmlElement> System::Xml::XmlDocument::CreateElement ( const String qname)

Creates an XmlElement object representing an XML element with the specified qualified name.

Parameters
qnameThe element's qualified name
Returns
A shared pointer to the created XmlElement object

◆ CreateElement() [2/3]

ASPOSECPP_SHARED_API SharedPtr<XmlElement> System::Xml::XmlDocument::CreateElement ( const String qualifiedName,
const String namespaceURI 
)

Creates an XmlElement object representing an XML element with the specified qualified name and namespace URI.

Parameters
qualifiedNameThe element's qualified name
namespaceURIThe elements's namespace URI
Returns
A shared pointer to the created XmlElement object

◆ CreateElement() [3/3]

ASPOSECPP_SHARED_API SharedPtr<XmlElement> System::Xml::XmlDocument::CreateElement ( const String prefix,
const String localName,
const String namespaceURI 
)

Creates an XmlElement object representing an XML element with the specified prefix, local name and namespace URI.

Parameters
prefixThe element's prefix
localNameThe element's local name
namespaceURIThe element's namespace URI
Returns
A shared pointer to the created XmlElement object

◆ CreateNavigator()

ASPOSECPP_SHARED_API SharedPtr<XPath::XPathNavigator> System::Xml::XmlDocument::CreateNavigator ( )
overridevirtual

Creates an instance of XPath::XPathNavigator class for navigating an XML document represented by the current object.

Reimplemented from System::Xml::XmlNode.

◆ CreateNode()

ASPOSECPP_SHARED_API SharedPtr<XmlNode> System::Xml::XmlDocument::CreateNode ( XmlNodeType  type,
const String qname,
const String namespaceURI = u"" 
)

Creates an XmlNode object representing an XML node of the specified type with the specified qualified name and namespace URI.

Parameters
typeThy type of the node to create
qnameThe node's qualified name
namespaceURIThe node's namespace URI
Returns
A shared pointer to the created XmlNode object

◆ CreateProcessingInstruction()

ASPOSECPP_SHARED_API SharedPtr<XmlProcessingInstruction> System::Xml::XmlDocument::CreateProcessingInstruction ( const String target,
const String data 
)

Creates an XmlProcessingInstruction object representing an XML processing instruction node with the specified values of 'target' and 'data' attributes.

Parameters
targetThe value of 'target' attribute of the XML processing instruction node represented by the object being constructed
dataThe value of 'data' attribute of the XML processing instruction node represented by the object being constructed
Returns
A shared pointer to the created XmlProcessingInstruction object

◆ CreateSignificantWhitespace()

System::SharedPtr<XmlSignificantWhitespace> System::Xml::XmlDocument::CreateSignificantWhitespace ( String  text)

Creates an XmlSignificantWhitespace object.

Parameters
textWhitespace text.
Returns
A shared pointer to the created object.

◆ CreateTextNode()

ASPOSECPP_SHARED_API SharedPtr<XmlText> System::Xml::XmlDocument::CreateTextNode ( const String text)

Creates an XmlText object representing an XML text node with the specified content.

Parameters
textThe content of the XML text node
Returns
A shared pointer to the created XmlText object

◆ CreateWhitespace()

System::SharedPtr<XmlWhitespace> System::Xml::XmlDocument::CreateWhitespace ( String  text)

Creates an XmlWhitespace object.

Parameters
textWhitespace text.
Returns
A shared pointer to the created object.

◆ CreateXmlDeclaration()

ASPOSECPP_SHARED_API SharedPtr<XmlDeclaration> System::Xml::XmlDocument::CreateXmlDeclaration ( const String version,
const String encoding = u"",
const String standalone = u"" 
)

Creates an XmlDeclaration object representing an XML declaration node with the specified values of 'version', 'encoding' and 'standalone' attributes.

Parameters
versionThe value of 'version' attribute of the XML declaration node represented by the object being constructed
encodingThe value of 'encoding' attribute of the XML declaration node represented by the object being constructed
standaloneThe value of 'standalone' attribute of the XML declaration node represented by the object being constructed
Returns
A shared pointer to the created XmlDeclaration object

◆ get_BaseURI()

ASPOSECPP_SHARED_API String System::Xml::XmlDocument::get_BaseURI ( ) const
overridevirtual

Gets the base URI of the current document.

Returns
The base URI string

Reimplemented from System::Xml::XmlNode.

◆ get_DocumentElement()

ASPOSECPP_SHARED_API XmlElement::Ptr System::Xml::XmlDocument::get_DocumentElement ( )

Returns the root XmlElement of the XML document node represented by the current object.

◆ get_DocumentType()

ASPOSECPP_SHARED_API XmlDocumentType::Ptr System::Xml::XmlDocument::get_DocumentType ( ) const

Gets the node containing the DOCTYPE declaration.

◆ get_FirstChild()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::get_FirstChild ( ) const
overridevirtual

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

Reimplemented from System::Xml::XmlNode.

◆ get_LastChild()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::get_LastChild ( ) const
overridevirtual

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

Reimplemented from System::Xml::XmlNode.

◆ get_Name()

String System::Xml::XmlDocument::get_Name ( ) const
inlineoverridevirtual

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

Implements System::Xml::XmlNode.

◆ get_NameTable()

XmlNameTable::Ptr System::Xml::XmlDocument::get_NameTable ( )
inline

Returns the XmlNameTable object associated with the current object.

◆ get_NextSibling()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::get_NextSibling ( ) const
overridevirtual

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

Returns
Null-pointer

Reimplemented from System::Xml::XmlNode.

◆ get_OuterXml()

ASPOSECPP_SHARED_API String System::Xml::XmlDocument::get_OuterXml ( ) const
overridevirtual

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

Reimplemented from System::Xml::XmlNode.

◆ get_OwnerDocument()

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

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

Returns
Null-pointer

Reimplemented from System::Xml::XmlNode.

◆ get_ParentNode()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::get_ParentNode ( ) const
overridevirtual

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

Returns
Null-pointer

Reimplemented from System::Xml::XmlNode.

◆ get_PreserveWhitespace()

bool System::Xml::XmlDocument::get_PreserveWhitespace ( ) const
inline

Returns a value indicating whether to preserve insignificant white spaces in XML content.

◆ get_PreviousSibling()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::get_PreviousSibling ( ) const
overridevirtual

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

Returns
Null-pointer

Reimplemented from System::Xml::XmlNode.

◆ get_Value()

String System::Xml::XmlDocument::get_Value ( ) const
inlineoverridevirtual

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

Returns
An empty string

Reimplemented from System::Xml::XmlNode.

◆ GetElementById()

ASPOSECPP_SHARED_API SharedPtr<XmlElement> System::Xml::XmlDocument::GetElementById ( const String elementId)

NOT IMPLEMENTED

Exceptions
NotImplementedException

◆ GetElementsByTagName() [1/2]

ASPOSECPP_SHARED_API SharedPtr<XmlNodeList> System::Xml::XmlDocument::GetElementsByTagName ( const String name)

Returns a list of XmlNode objects representing the XML elements whose qualified name matches the specifed value.

Parameters
nameThe string to match the XML elements' names against
Returns
A list of XmlNode objects representing all document's descendant XML elements whose name matches name

◆ GetElementsByTagName() [2/2]

ASPOSECPP_SHARED_API SharedPtr<XmlNodeList> System::Xml::XmlDocument::GetElementsByTagName ( const String localName,
const String namespaceURI 
)

Returns a list of XmlNode objects representing the XML elements whose local name and namespace URI match the specifed values.

Parameters
localNameThe string to match the XML elements' local names against
namespaceURIThe string to match the XML elements' namespace URI against
Returns
A list of XmlNode objects representing all document's descendant XML elements whose local names match localName and namespace URIs match namespace URI

◆ idx_get()

ASPOSECPP_SHARED_API XmlElement::Ptr System::Xml::XmlDocument::idx_get ( String  name) const
overridevirtual

Returns an XmlElement object representing an XML element with the specified name which is a child of the node represented by the current object.

Reimplemented from System::Xml::XmlNode.

◆ ImportNode()

ASPOSECPP_SHARED_API SharedPtr<XmlNode> System::Xml::XmlDocument::ImportNode ( const SharedPtr< XmlNode > &  node,
bool  deep 
)

Imports the specified XML node from another XML document.

Parameters
nodeThe node to import
deepSpecifies whether to perform deep clone of the node (true) or not (false)

◆ InsertAfter()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::InsertAfter ( XmlNode::Ptr  child,
XmlNode::Ptr  ref_child 
)
overridevirtual

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

Parameters
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 from System::Xml::XmlNode.

◆ InsertBefore()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::InsertBefore ( XmlNode::Ptr  child,
XmlNode::Ptr  ref_child 
)
overridevirtual

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
childThe XML node to add
ref_childThe reference node indicating the position in the list of children prior to which node should be inserted
Returns
A shared pointer to the specified XmlNode object child

Reimplemented from System::Xml::XmlNode.

◆ Load() [1/4]

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::Load ( const String filename)

Loads an XML document from the specified URL; URL can be a file or an HTTP URL.

Parameters
filenameThe URL

◆ Load() [2/4]

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::Load ( const SharedPtr< System::IO::Stream > &  stream)

Loads an XML document from the specified stream.

Parameters
streamThe stream to load the XML document from

◆ Load() [3/4]

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::Load ( const SharedPtr< System::IO::TextReader > &  reader)

Loads an XML document from the specified TextReader object.

Parameters
readerThe TextReader object to load the XML document from

◆ Load() [4/4]

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::Load ( const SharedPtr< XmlReader > &  reader)

Loads an XML document from the specified XmlReader object.

Parameters
readerThe XmlReader object to load the XML document from

◆ LoadXml()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::LoadXml ( const String xml)

Loads an XML document from the specified string.

Parameters
xmlThe string containing an XML document to load

◆ native_doc()

xmlDoc* System::Xml::XmlDocument::native_doc ( ) const
inline

Retirns a pointer to the underlying xmlDoc object.

◆ onNodeChanged()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::onNodeChanged ( const XmlNode::Ptr node,
const XmlNode::Ptr parent,
const String oldValue,
const String newValue 
)
protected

Triggers NodeChanged event

Parameters
nodeThe XML node whose value has been changed
parentThe parent node of node
oldValueThe value that the node had before the change
newValueThe current value of node

◆ onNodeChanging()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::onNodeChanging ( const XmlNode::Ptr node,
const XmlNode::Ptr parent,
const String oldValue,
const String newValue 
)
protected

Triggers NodeChanging event

Parameters
nodeThe XML node whose value is about to be changed
parentThe parent node of node
oldValueThe current value of the node node
newValueThe value that is about to be set

◆ onNodeInserted()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::onNodeInserted ( const XmlNode::Ptr node,
const XmlNode::Ptr newParent 
)
protected

Triggers NodeInserted event

Parameters
nodeThe XML node that has been inserted
newParentThe XML node that has become a new parent node for node

◆ onNodeInserting()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::onNodeInserting ( const XmlNode::Ptr node,
const XmlNode::Ptr newParent 
)
protected

Triggers NodeInserting event

Parameters
nodeThe XML node that is about to be inserted
newParentThe XML node that is about to become a new parent node for node

◆ onNodeRemoved()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::onNodeRemoved ( const XmlNode::Ptr node,
const XmlNode::Ptr oldParent 
)
protected

Triggers NodeRemoved event

Parameters
nodeThe XML node that has been removed
oldParentThe XML node from the children list of which node has been removed

◆ onNodeRemoving()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::onNodeRemoving ( const XmlNode::Ptr node,
const XmlNode::Ptr oldParent 
)
protected

Triggers NodeRemoving event

Parameters
nodeThe XML node that is about to be removed
oldParentThe XML node from the children list of which node is about to be removed

◆ PrependChild()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::PrependChild ( XmlNode::Ptr  child)
overridevirtual

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

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

Reimplemented from System::Xml::XmlNode.

◆ ReadNode()

virtual ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::ReadNode ( const SharedPtr< XmlReader reader)
virtual

Reads node from XmlReader.

Parameters
readerReader to read node from.
Returns
Pointer to the node that was read.

◆ RemoveChild()

ASPOSECPP_SHARED_API XmlNode::Ptr System::Xml::XmlDocument::RemoveChild ( XmlNode::Ptr  child)
overridevirtual

Removes the specified XML node from the list of children of the XML document represented by the current object.

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

Reimplemented from System::Xml::XmlNode.

◆ Save() [1/4]

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::Save ( const String filename) const

Saves the XML document represented by the current object to the specified file.

Parameters
filenameA path to the file to save the XML document to

◆ Save() [2/4]

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::Save ( const SharedPtr< System::IO::Stream > &  stream) const

Saves the XML document represented by the current object to the specified stream.

Parameters
streamA stream to save the XML document to

◆ Save() [3/4]

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::Save ( const SharedPtr< System::IO::TextWriter > &  writer) const

Saves the XML document represented by the current object to the specified TextWriter object.

Parameters
writerA TextWriter object to save the XML document to

◆ Save() [4/4]

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::Save ( const SharedPtr< XmlWriter > &  writer) const

Saves the XML document represented by the current object to the specified XmlWriter object.

Parameters
writerAn XmlWriter object to save the XML document to

◆ SelectNodes() [1/2]

SharedPtr<XmlNodeList> System::Xml::XmlDocument::SelectNodes ( String  xpath)
inlineoverridevirtual

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 from System::Xml::XmlNode.

◆ SelectNodes() [2/2]

SharedPtr<XmlNodeList> System::Xml::XmlDocument::SelectNodes ( String  xpath,
SharedPtr< XmlNamespaceManager nsmgr 
)
inlineoverridevirtual

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 from System::Xml::XmlNode.

◆ SelectSingleNode()

SharedPtr<XmlNode> System::Xml::XmlDocument::SelectSingleNode ( String  xpath,
SharedPtr< XmlNamespaceManager nsmgr = nullptr 
)
inlineoverridevirtual

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 from System::Xml::XmlNode.

◆ set_InnerText()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::set_InnerText ( String  text)
overridevirtual

NOT APPLICABLE.

Exceptions
InvalidOperationExceptionAlways

Reimplemented from System::Xml::XmlNode.

◆ set_PreserveWhitespace()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::set_PreserveWhitespace ( bool  value)

Sets a value indicating whether to preserve insignificant white spaces in XML content.

◆ set_XmlResolver()

ASPOSECPP_SHARED_API void System::Xml::XmlDocument::set_XmlResolver ( const SharedPtr< XmlResolver > &  value)

Sets the XML Resolver object used to access external XML documents.

Parameters
valueThe XmlResolver object to set

◆ SetBaseURI()

void System::Xml::XmlDocument::SetBaseURI ( const String base_uri)

◆ WriteContentTo()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlDocument::WriteContentTo ( SharedPtr< XmlWriter writer)
overridevirtual

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

Parameters
writerA XmlWriter object to save the chlid nodes to

Reimplemented from System::Xml::XmlNode.

◆ WriteTo()

virtual ASPOSECPP_SHARED_API void System::Xml::XmlDocument::WriteTo ( SharedPtr< XmlWriter writer)
overridevirtual

Saves the XML document node represented by the current object to the specified XmlWriter object.

Parameters
writerA XmlWriter object to save the node to

Implements System::Xml::XmlNode.

Member Data Documentation

◆ m_nameTable

NameTable::Ptr System::Xml::XmlDocument::m_nameTable
protected

The nametable used by the current object.

◆ m_preserveWhitespace

bool System::Xml::XmlDocument::m_preserveWhitespace
protected

The flag indicating whether to preserve insignificant white spaces.

◆ m_xmlDeclarationNode

XmlDeclaration::Ptr System::Xml::XmlDocument::m_xmlDeclarationNode
protected

XML declaration node of the XML document represented by the current object.

◆ NodeChanged

XmlNodeChangedEventSignal System::Xml::XmlDocument::NodeChanged

An event that is triggered when the value of the XML node belonging to the XML document represented by the current object hes been modified.

◆ NodeChanging

XmlNodeChangedEventSignal System::Xml::XmlDocument::NodeChanging

An event that is triggered when the value of the XML node belonging to the XML document represented by the current object is about to be modified.

◆ NodeInserted

XmlNodeChangedEventSignal System::Xml::XmlDocument::NodeInserted

An event that is triggered when an XML node belonging to the XML document represented by the current object has been inserted into another XML node.

◆ NodeInserting

XmlNodeChangedEventSignal System::Xml::XmlDocument::NodeInserting

An event that is triggered when an XML node belonging to the XML document represented by the current object is about to be inserted into another XML node.

◆ NodeRemoved

XmlNodeChangedEventSignal System::Xml::XmlDocument::NodeRemoved

An event that is triggered when an XML node belonging to the XML document represented by the current object has been removed from the list of children of its parent node.

◆ NodeRemoving

XmlNodeChangedEventSignal System::Xml::XmlDocument::NodeRemoving

An event that is triggered when an XML node belonging to the XML document represented by the current object is about to be removed from the list of children of its parent node.