Functions
XML DOM

Functions

int mdlXMLDom_createWithParameters (XmlDomRef *pDomRef, bool bFreeThreaded, bool bAsync, bool bValidate, bool bResolveExtern, bool bPreserveWhiteSpace)
 Creates an instance of a DOM Class with given parameters. More...
 
int mdlXMLDom_create (XmlDomRef *pDomRef)
 Creates an instance of a DOM Class. More...
 
int mdlXMLDom_createFreeThreaded (XmlDomRef *pDomRef)
 Creates a free threaded instance of a DOM Class. More...
 
int mdlXMLDom_createFromText (XmlDomRef *pDomRef, bool bFreeThreaded, WChar const *pXmlText)
 Creates an instance of a DOM Class from a well-formed XML text string. More...
 
int mdlXMLDom_createFromNode (XmlDomRef *pDomRef, bool bFreeThreaded, XmlNodeRef sourceNodeRef, bool deepClone)
 Creates an instance of a DOM Class from an existing DOM using XPath criteria. More...
 
int mdlXMLDom_createFromFragment (XmlDomRef *pDomRef, bool bFreeThreaded, XmlDomRef sourceDomRef, WChar const *pXpath, bool deepClone)
 Creates an instance of a DOM Class from an existing DOM using XPath criteria. More...
 
int mdlXMLDom_free (XmlDomRef domRef)
 Frees an instance of a DOM Class. More...
 
int mdlXMLDom_getParameter (XmlDomRef domRef, int parameterType, bool *parameterValue)
 Sets Parameters on the given DOM. More...
 
int mdlXMLDom_setParameter (XmlDomRef domRef, int parameterType, bool parameterValue)
 Sets parameters from the given DOM. More...
 
int mdlXMLDom_setProperty (XmlDomRef domRef, WChar const *propertyName, WChar const *propertyValue)
 Sets a property from the given DOM to the given value. More...
 
int mdlXMLDom_getProperty (XmlDomRef domRef, WChar const *propertyName, WChar *propertyValue)
 Get a property from the given DOM with the given name. More...
 
int mdlXMLDom_load (XmlDomRef domRef, int fileSpecType, WChar const *pFileSpec, WChar const *pStorageSpec, WChar const *pStreamSpec)
 Loads a XML Dom Class using the given file spec. More...
 
int mdlXMLDom_save (XmlDomRef domRef, int fileSpecType, WChar const *pFileSpec, WChar const *pStorageSpec, WChar const *pStreamSpec, WChar const *pEncoding, bool bCompress, bool bOverwrite, bool bFormat)
 Saves the give DOM out to the given file spec. More...
 
int mdlXMLDom_getParseError (long *pErrorCode, long *pFilepos, long *pLine, long *pLinepos, WCharP pReason, int maxReasonLength, WCharP pSrcText, int maxSrcTextLength, WCharP pUrl, int maxUrlLength, XmlDomRef domRef)
 Returns the last Parse Error if one of the dom creation function fails. More...
 
int mdlXMLDom_getRootNode (XmlNodeRef *pNodeRef, XmlDomRef domRef)
 Returns the given root node for the given DOM. More...
 
int mdlXMLDom_getRootElement (XmlNodeRef *pNodeRef, XmlDomRef domRef)
 Gets the root element (document element) from the given DOM. More...
 
int mdlXMLDom_setRootElement (XmlDomRef domRef, XmlNodeRef nodeRef)
 Sets the current node as the root (document) element for the given DOM. More...
 
int mdlXMLDom_createCDataSection (XmlNodeRef *pNodeRef, XmlDomRef domRef, WChar const *pCData)
 Creates a new XML CDATA node, but does not insert it. More...
 
int mdlXMLDom_createComment (XmlNodeRef *pNodeRef, XmlDomRef domRef, WChar const *pComment)
 Creates a new XML Comment node, but does not insert it. More...
 
int mdlXMLDom_createDocumentFragment (XmlNodeRef *pNodeRef, XmlDomRef domRef, WChar const *pDocumentFragment)
 Creates a new XML Document Fragment node, but does not insert it. More...
 
int mdlXMLDom_createDocumentFragmentExt (XmlNodeRef *pNodeRef, XmlDomRef domRef, WChar const *pDocumentFragment, bool bFreeThreaded)
 Creates a new XML Document Fragment node, but does not insert it. More...
 
int mdlXMLDom_createDocumentFragmentFromFile (XmlNodeRef *pNodeRef, XmlDomRef domRef, WChar const *pFilename, bool bIncludeRootNode)
 Creates a new XML Document Fragment node from a given file, but does not append it to a DOM. More...
 
int mdlXMLDom_createElement (XmlNodeRef *pNodeRef, XmlDomRef domRef, WChar const *pTagName)
 Creates a new XML Element node, but does not append it to a DOM. More...
 
int mdlXMLDom_createNode (XmlNodeRef *pNodeRef, XmlDomRef domRef, int nodeType, WChar const *pName, WChar const *pNamespaceURI)
 Creates a new XML node of type nodeType, but does not append it to a DOM. More...
 
int mdlXMLDom_createProcessingInstruction (XmlNodeRef *pNodeRef, XmlDomRef domRef, WChar const *pTarget, WChar const *pData)
 Creates a new XML Processing Instruction node, but does not append it to a DOM. More...
 
int mdlXMLDom_createTextNode (XmlNodeRef *pNodeRef, XmlDomRef domRef, WChar const *pTextData)
 Creates a new XML Processing Instruction node, but does not append it to a DOM. More...
 
int mdlXMLDom_appendChild (XmlDomRef domRef, XmlNodeRef nodeRef)
 Appends an XML node as the last child to the XML Dom. More...
 
int mdlXMLDom_removeChild (XmlDomRef domRef, XmlNodeRef nodeRef)
 Removes a node from an XML DOM. More...
 
int mdlXMLDom_replaceChild (XmlDomRef domRef, XmlNodeRef nodeToReplaceRef, XmlNodeRef replacementNodeRef)
 Replaces a node in an XML DOM. More...
 
int mdlXMLDom_insertElement (XmlNodeRef *pNodeRef, XmlDomRef domRef, XmlNodeRef beforeNodeRef, int tagValueType, WChar const *pTagName, const void *pTagValue)
 Adds a new XML element to an existing XML DOM. More...
 
int mdlXMLDom_addElement (XmlNodeRef *pNodeRef, XmlDomRef domRef, XmlNodeRef parentNodeRef, int tagValueType, WChar const *pTagName, const void *pTagValue)
 Adds a new XML element to an existing XML DOM. More...
 
int mdlXMLDom_addElementUsingNamespace (XmlNodeRef *pNodeRef, XmlDomRef domRef, XmlNodeRef parentNodeRef, int tagValueType, WChar const *pNamespaceURI, WChar const *pTagName, const void *pTagValue)
 Adds a new XML namespaced element to an existing XML DOM. More...
 
int mdlXMLDom_replaceOrAppendNodesByXPath (XmlNodeRef *pNodeRef, XmlDomRef domRef, XmlNodeRef startNodeRef, WChar const *pXpath, int tagValueType, const void *pTagValue, int appendFlags)
 Adds a series of XML elements and/or an attribute to an existing XML DOM starting at startNode. More...
 
int mdlXMLDom_selectSingleNode (XmlNodeRef *pNodeRef, XmlDomRef sourceDomRef, WChar const *pXpath)
 Selects the first Node that matches the XPath Criteria. More...
 
int mdlXMLDom_select (XmlNodeListRef *pNodeListRef, XmlDomRef sourceDomRef, WChar const *pXpath)
 Returns a list of XML Nodes that match the given XPath Criteria. More...
 
int mdlXMLDom_validate (XmlDomRef domRef)
 Validates the XML Dom against the previous set schema cache. More...
 
int mdlXMLDom_getValidateError (long *pErrorCode, long *pFilepos, long *pLine, long *pLinepos, WCharP pReason, int maxReasonLength, WCharP pSrcText, int maxSrcTextLength, WCharP pUrl, int maxUrlLength, XmlDomRef domRef)
 Returns the last validate error if one of the dom creation function fails. More...
 
int mdlXMLDom_validateAgainstSchemaCache (XmlDomRef domRef, XmlSchemaCacheRef schemaCacheRef)
 Validates the XML Dom against the given schema cache. More...
 
int mdlXMLDom_validateAgainstSchema (XmlDomRef domRef, WChar const *pXMLNSTarget, WChar const *pSchemaFilename)
 Validates the XML DOM against the given schema file name. More...
 
int mdlXMLDom_setSchemaCache (XmlDomRef domRef, XmlSchemaCacheRef schemaCacheRef)
 Associates the schema cache to the given XML DOM. More...
 
int mdlXMLDomNode_insertBefore (XmlNodeRef nodeBeforeRef, XmlNodeRef nodeToInsertRef)
 Inserts XML node before another XML Node. More...
 
int mdlXMLDomNode_cloneNode (XmlNodeRef *pClonedNodeRef, XmlNodeRef nodeRef, bool deepClone)
 Clones the given XML Node. More...
 
int mdlXMLDomNode_selectSingleNode (XmlNodeRef *pNodeRef, XmlNodeRef sourceNodeRef, WChar const *pXpath)
 Returns first XML NOde that matches the given XPath Criteria. More...
 
int mdlXMLDomNode_select (XmlNodeListRef *pNodeListRef, XmlNodeRef sourceNodeRef, WChar const *pXpath)
 Returns a list of XML Nodes that matches the given XPath Criteria. More...
 
int mdlXMLDomElement_removeAttribute (XmlNodeRef nodeRef, WChar const *pAttributeName)
 Remove the specified XML attribute from the given XML Element Node. More...
 
int mdlXMLDomElement_addAttribute (XmlNodeRef nodeRef, int attributeType, WChar const *pAttributeName, const void *pAttributeValue)
 Adds an XML attribute to the given XML Element Node. More...
 
int mdlXMLDomElement_addAttributeUsingNamespace (XmlDomRef domRef, XmlNodeRef nodeRef, int attributeType, WChar const *pNamespaceURI, WChar const *pAttributeName, const void *pAttributeValue)
 Adds an XML attribute to the given XML Element Node using namespaces. More...
 
int mdlXMLDomElement_appendAttributeNode (XmlNodeRef nodeRef, XmlNodeRef attributeNodeRef)
 Adds an XML attribute to the given XML Element Node. More...
 
int mdlXMLDomElement_getAttributeExt (void *pValue, int *pMaxChars, XmlNodeRef nodeRef, WChar const *pAttributeName, int attributeType, bool bFailIfAttributeMissing)
 Returns the attribute value of the given name on the given XML element. More...
 
int mdlXMLDomElement_getAttribute (void *pValue, int *pMaxChars, XmlNodeRef nodeRef, WChar const *pAttributeName, int attributeType)
 Returns the attribute value of the given name on the given XML element. More...
 
int mdlXMLDomElement_getValue (void *pValue, int *pMaxChars, XmlNodeRef nodeRef, int attributeType)
 Returns the text value for the given XML Element. More...
 
int mdlXMLDomElement_setValue (XmlNodeRef nodeRef, WChar const *pValueString)
 Set the given XML Element value to be pValue. More...
 
int mdlXMLDomElement_appendChild (XmlNodeRef nodeToAppendAfterRef, XmlNodeRef nodeToAppendRef)
 Appends a XML Node as a Child to the give XML Element Node. More...
 
int mdlXMLDomElement_getAllAttributes (XmlNamedNodeMapRef *pNodeMapRef, XmlNodeRef nodeRef)
 Returns an XML Named Nop Map with all attributes for the given XML Element. More...
 
int mdlXMLDomNodeList_getNextChildElement (XmlNodeRef *childNodeP, WChar *childNodeNameP, XmlNodeListRef *childNodeListP, XmlNodeRef parentNode)
 Returns the next child element from the current XML Node List. More...
 
void mdlXMLDomNodeList_initProcessChildren (XmlNodeRef *childNodeP, XmlNodeListRef *childNodeListP)
 Initializes a XML Node and XML Node List for use with mdlXMLDomNodeList_getNextChildElement. More...
 
int mdlXMLDomNodeList_select (XmlNodeListRef *pNodeListRef, XmlDomRef domRef, WChar const *pXpath)
 Returns a list of XML Nodes that match the given XPath Criteria. More...
 
long mdlXMLDomNodeList_getNumChildren (XmlNodeListRef nodeListRef)
 Returns the number in given XML Node List. More...
 
int mdlXMLDomNodeList_getFirstChild (XmlNodeRef *pNodeRef, XmlNodeListRef nodeListRef)
 Returns the first XML Child Node in given XML Node List. More...
 
int mdlXMLDomNodeList_getNextChild (XmlNodeRef *pNodeRef, XmlNodeListRef nodeListRef)
 Returns the next XML Child Node in given XML Node List. More...
 
int mdlXMLDomNodeList_getChild (XmlNodeRef *pNodeRef, XmlNodeListRef nodeListRef, long index)
 Returns the XML Child Node at the given index in the XML Node List. More...
 
int mdlXMLDomNodeList_traverse (XmlNodeListRef nodeListRef, int options, int(*userFuncNodeListTraverse)(XmlNodeRef node, void *userArgs), void *userArg)
 Transverses the given XML Dom Node List and calls the user function for each XML Node in the list. More...
 
int mdlXMLDomNodeList_free (XmlNodeListRef nodeListRef)
 Frees the given XML Node List. More...
 
void mdlXMLDomNode_verboseElement (XmlNodeRef nodeRef)
 Prints out the XML Element Node Name for debugging purposes only. More...
 
bool mdlXMLDomNode_hasChildNodes (XmlNodeRef nodeRef)
 Returns true if the given XML Node has child nodes. More...
 
int mdlXMLDomNode_getChildNodes (XmlNodeListRef *pNodeListRef, XmlNodeRef nodeRef)
 Returns a XML node list of child nodes of the given XML Node. More...
 
int mdlXMLDomNode_getName (WChar *pNodeName, int *pMaxChars, XmlNodeRef nodeRef)
 Gets the node name of the current Xml Node. More...
 
int mdlXMLDomNode_getNodeType (long *pNodeType, XmlNodeRef nodeRef)
 Returns the node type for the given XML Node. More...
 
int mdlXMLDomNode_getXmlText (WChar *pValueString, int *pMaxChars, XmlNodeRef nodeRef)
 Returns the XML Text of the given XML Node. More...
 
int mdlXMLDomNode_getValue (WChar *pValueString, int *pMaxChars, XmlNodeRef nodeRef)
 Returns the value of given XML Node. More...
 
int mdlXMLDomNode_setValue (XmlNodeRef nodeRef, WChar const *pValueString)
 Sets the value for the given XML Node. More...
 
int mdlXMLDomNode_replaceChild (XmlNodeRef parentNodeRef, XmlNodeRef nodeToReplaceRef, XmlNodeRef replacementNodeRef)
 Replaces a node in an XML DOM. More...
 
int mdlXMLDomNode_getParentNode (XmlNodeRef *parentNodeRef, XmlNodeRef nodeToGetParentRef)
 Gets the parent node of the given element. More...
 
int mdlXMLDomNode_free (XmlNodeRef nodeRef)
 Frees the XML Dom Node. More...
 
long mdlXMLDomAttrList_getNumChildren (XmlNamedNodeMapRef nodeMapRef)
 Returns the number of attributes in the attribute list. More...
 
int mdlXMLDomAttrList_getFirstChild (XmlNodeRef *pNodeRef, XmlNamedNodeMapRef nodeMapRef)
 Returns the first attribute in the attribute list. More...
 
int mdlXMLDomAttrList_getNextChild (XmlNodeRef *pNodeRef, XmlNamedNodeMapRef nodeMapRef)
 Returns the next attribute in the attribute list. More...
 
int mdlXMLDomAttrList_getChildByName (XmlNodeRef *pNodeRef, XmlNamedNodeMapRef nodeMapRef, WChar const *pAttrName)
 Returns an XML Attribute node by name. More...
 
int mdlXMLDomAttrList_getChild (XmlNodeRef *pNodeRef, XmlNamedNodeMapRef nodeMapRef, int index)
 Returns an XML Attribute node by index. More...
 
int mdlXMLDomAttrList_free (XmlNamedNodeMapRef nodeMapRef)
 Frees the attribute list. More...
 
int mdlXMLDomAttr_getName (WChar *pAttrNodeName, int *pMaxChars, XmlNodeRef attrNodeRef)
 Returns the name of the given XML Attribute Node. More...
 
int mdlXMLDomAttr_getValue (WChar *pAttrValueString, int *pMaxChars, XmlNodeRef attrNodeRef)
 Returns the value of the given XML Attribute Node. More...
 
int mdlXMLDomAttr_setValue (XmlNodeRef attrNodeRef, WChar const *pAttrValueString)
 Sets the values of the XML Attribute Node. More...
 

Detailed Description

Function Documentation

int mdlXMLDom_addElement ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
XmlNodeRef  parentNodeRef,
int  tagValueType,
WChar const *  pTagName,
const void *  pTagValue 
)

Adds a new XML element to an existing XML DOM.

Parameters
[out]pNodeRefReturned newly created XML Element Node, can be NULL
[in]domRefReference to DOM class
[in]parentNodeRefParent XML Node to be appended to
[in]tagValueTypeXMLDATATYPE_EMPTY, _T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
[in]pTagNameTag name for element node
[in]pTagValueTag value for element node or NULL for an empty element
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free. Pass NULL for tag value when using XMLDATATYPE_EMPTY.
See also
mdlXMLDomNode_free
mdlXMLDom_addElementUsingNamespace
int mdlXMLDom_addElementUsingNamespace ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
XmlNodeRef  parentNodeRef,
int  tagValueType,
WChar const *  pNamespaceURI,
WChar const *  pTagName,
const void *  pTagValue 
)

Adds a new XML namespaced element to an existing XML DOM.

Parameters
[out]pNodeRefReturned newly created XML Element Node, can be NULL
[in]domRefReference to DOM class
[in]parentNodeRefParent XML Node to be appended to
[in]tagValueTypeXMLDATATYPE_EMPTY, _T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
[in]pNamespaceURINamespace for element node
[in]pTagNameTag name for element node
[in]pTagValueTag value for element node or NULL for an empty element
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free. Pass NULL for tag value when using XMLDATATYPE_EMPTY.
See also
mdlXMLDomNode_free
mdlXMLDom_addElement
int mdlXMLDom_appendChild ( XmlDomRef  domRef,
XmlNodeRef  nodeRef 
)

Appends an XML node as the last child to the XML Dom.

Returns
SUCCESS or ERROR
Parameters
[in]domRefReference to DOM class
[in]nodeRefnode to append
int mdlXMLDom_create ( XmlDomRef pDomRef)

Creates an instance of a DOM Class.

Parameters
[out]pDomRefNewly created DOM
Remarks
pDomRef must be freed by calling mdlXMLDom_free
See also
mdlXMLDom_free
Returns
SUCCESS or ERROR
int mdlXMLDom_createCDataSection ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
WChar const *  pCData 
)

Creates a new XML CDATA node, but does not insert it.

Parameters
[out]pNodeRefreturned newly created CDATA Node
[in]domRefReference to DOM class
[in]pCDatastring to create CDATA node from
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDom_createComment ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
WChar const *  pComment 
)

Creates a new XML Comment node, but does not insert it.

Parameters
[out]pNodeRefreturned newly created XML Comment Node
[in]domRefReference to DOM class
[in]pCommentstring to create Comment node from
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDom_createDocumentFragment ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
WChar const *  pDocumentFragment 
)

Creates a new XML Document Fragment node, but does not insert it.

Parameters
[out]pNodeRefreturned newly created XML Document Fragment Node
[in]domRefReference to DOM class
[in]pDocumentFragmentstring to create Document Fragment node from
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
Use mdlXMLDom_createDocumentFragmentExt to create a node when domRef is a FreeThreaded DOM node model
See also
mdlXMLDomNode_free
mdlXMLDom_createDocumentFragmentExt
int mdlXMLDom_createDocumentFragmentExt ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
WChar const *  pDocumentFragment,
bool  bFreeThreaded 
)

Creates a new XML Document Fragment node, but does not insert it.

Parameters
[out]pNodeRefreturned newly created XML Document Fragment Node
[in]domRefReference to DOM class
[in]pDocumentFragmentstring to create Document Fragment node from
[in]bFreeThreadedis domRef freethreaded DOM?
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
mdlXMLDom_createDocumentFragment
int mdlXMLDom_createDocumentFragmentFromFile ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
WChar const *  pFilename,
bool  bIncludeRootNode 
)

Creates a new XML Document Fragment node from a given file, but does not append it to a DOM.

Parameters
[out]pNodeRefreturned newly created XML Document Fragment Node
[in]domRefReference to DOM class
[in]pFilenamefile to create a document fragment file
[in]bIncludeRootNodeInclude root node when creating document fragment
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDom_createElement ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
WChar const *  pTagName 
)

Creates a new XML Element node, but does not append it to a DOM.

Parameters
[out]pNodeRefReturned newly created XML Element Node
[in]domRefReference to DOM class
[in]pTagNameTag name for element node
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDom_createFreeThreaded ( XmlDomRef pDomRef)

Creates a free threaded instance of a DOM Class.

Parameters
[out]pDomRefNewly created DOM
Remarks
pDomRef must be freed by calling mdlXMLDom_free
See also
mdlXMLDom_free
Returns
SUCCESS or ERROR
int mdlXMLDom_createFromFragment ( XmlDomRef pDomRef,
bool  bFreeThreaded,
XmlDomRef  sourceDomRef,
WChar const *  pXpath,
bool  deepClone 
)

Creates an instance of a DOM Class from an existing DOM using XPath criteria.

Parameters
[out]pDomRefNewly created DOM
[in]bFreeThreadedUse Free Threaded model
[in]sourceDomRefDOM to create new DOM from
[in]pXpathXpath criteria to generate DOM from
[in]deepClonetrue for deep clone, false for shallow clone
Remarks
pDomRef must be freed by calling mdlXMLDom_free
pXPath must point to a single XML Element which becomes the Root Element of pDomRef
See also
mdlXMLDom_free
Returns
SUCCESS or ERROR
int mdlXMLDom_createFromNode ( XmlDomRef pDomRef,
bool  bFreeThreaded,
XmlNodeRef  sourceNodeRef,
bool  deepClone 
)

Creates an instance of a DOM Class from an existing DOM using XPath criteria.

Parameters
[out]pDomRefNewly created DOM
[in]bFreeThreadedUse Free Threaded model
[in]sourceNodeRefNode to create new DOM from
[in]deepClonetrue for deep clone, false for shallow clone
Remarks
pDomRef must be freed by calling mdlXMLDom_free
See also
mdlXMLDom_free
Returns
SUCCESS or ERROR
int mdlXMLDom_createFromText ( XmlDomRef pDomRef,
bool  bFreeThreaded,
WChar const *  pXmlText 
)

Creates an instance of a DOM Class from a well-formed XML text string.

Parameters
[out]pDomRefNewly created DOM
[in]bFreeThreadedUse Free Threaded model
[in]pXmlTextText to generate DOM from
Remarks
pDomRef must be freed by calling mdlXMLDom_free, pXMLText must be a well-formed XML string, properly escaped
See also
mdlXMLDom_free
Returns
SUCCESS or ERROR
int mdlXMLDom_createNode ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
int  nodeType,
WChar const *  pName,
WChar const *  pNamespaceURI 
)

Creates a new XML node of type nodeType, but does not append it to a DOM.

Parameters
[out]pNodeRefReturned newly created XML Node
[in]domRefReference to DOM class
[in]nodeTypeType of node to create (see mdlxmltools.h for values)
[in]pNameName of node
[in]pNamespaceURINamespace URI
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free use in conjunction with mdlXMLDom_appendAttributeNode or mdlXMLDomElement_appendChild to create namespaced elements and attributes
See also
mdlXMLDomNode_free
mdlXMLDomElement_appendAttributeNode
mdlXMLDomElement_appendChild
int mdlXMLDom_createProcessingInstruction ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
WChar const *  pTarget,
WChar const *  pData 
)

Creates a new XML Processing Instruction node, but does not append it to a DOM.

Parameters
[out]pNodeRefReturned newly created XML Processing Instruction (PI) Node
[in]domRefReference to DOM class
[in]pTargetTarget (node name) for PI node
[in]pDataData (node value) for PI node
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDom_createTextNode ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
WChar const *  pTextData 
)

Creates a new XML Processing Instruction node, but does not append it to a DOM.

Parameters
[out]pNodeRefReturned newly created XML Text Node
[in]domRefReference to DOM class
[in]pTextDataText for Text Node
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
Returns
SUCCESS or ERROR
int mdlXMLDom_createWithParameters ( XmlDomRef pDomRef,
bool  bFreeThreaded,
bool  bAsync,
bool  bValidate,
bool  bResolveExtern,
bool  bPreserveWhiteSpace 
)

Creates an instance of a DOM Class with given parameters.

General XML Functions

This group of functions is a simplified API wrapper around Microsoft's XML Core Services API, also known as MSXML6. It is geared to the creation/manipulation of XML Data, and not optimized for XML Mixed Content. Access is process to MSXML6 Smart Pointers for more Advanced Use.

Include files

To use the API you include the following:

Linking

To use the API you link the following:

  • mdlxmltools.dlo - Link this file with MDL Objects.
  • mdlxmltools.lib - Link this file with C Objects.

Function Sets

  • XML DOM
  • XML SAX
  • XML Schemas
  • XML Transforms
  • XML Utility

XML DOM Functions

This group of functions is used to creation, and saving XML Documents by using the XML DOM. It can be used to navigate, or modifying nodes in an XML DOM. It can also be used to transform and validate an XML DOM.

XML SAX Functions

This group of functions is used to read/writing XML Documents use the XML SAX2 (Simple API for XML (SAX2) methods.

XML Schema Functions

This group of functions is usefult for navigating an W3C XML Schema definition language (XSD) document. These functions walk the XML Schema Document (.xsd), obtains properties and declartations, and the relationships between schema items.

It uses the MSXML4 Schema Object Model (SOM). See Microsoft's documentation for more information about the SOM.

XML Tranform Functions

This group of functions is useful for transform XML DOMs to other formats, such as HTML, XML, or other text file formats (such as another XML DOM, stream, string. It is based on the Extensible Stylesheet Language Transformations (XSLT).

XML Utility Functions

This group of functions does not map directly to the Microsoft's XML Core Services API and are provided only as a convenience. Currently there is only one function in this group.

Parameters
[out]pDomRefNewly created DOM
[in]bFreeThreadedUse Free Threaded model
[in]bAsyncSet ASYNC?
[in]bValidateValidate on parse?
[in]bResolveExternResolve externs on parse?
[in]bPreserveWhiteSpacePreserve whitespace on parse?
Remarks
pDomRef must be freed by calling mdlXMLDom_free
See also
mdlXMLDom_free
Returns
SUCCESS or ERROR
int mdlXMLDom_free ( XmlDomRef  domRef)

Frees an instance of a DOM Class.

Parameters
[in]domRefDOM class to free
Returns
SUCCESS or ERROR
See also
mdlXMLDom_create
int mdlXMLDom_getParameter ( XmlDomRef  domRef,
int  parameterType,
bool *  parameterValue 
)

Sets Parameters on the given DOM.

Returns
SUCCESS or ERROR
Parameters
[in]domRefReference to DOM class
[in]parameterTypeDOM_PARAMETER_* in mdlxmltools.h
[out]parameterValuetrue or false, value of parameterType for this DOM
Remarks
parameterType(s) are defined in mdlxmltools.h
int mdlXMLDom_getParseError ( long *  pErrorCode,
long *  pFilepos,
long *  pLine,
long *  pLinepos,
WCharP  pReason,
int  maxReasonLength,
WCharP  pSrcText,
int  maxSrcTextLength,
WCharP  pUrl,
int  maxUrlLength,
XmlDomRef  domRef 
)

Returns the last Parse Error if one of the dom creation function fails.

Parameters
[out]pErrorCodeContains the error code of the last parse error, or NULL if NOT wanted
[out]pFileposContains the absolute file position where the error occurred, or NULL if NOT wanted
[out]pLineSpecifies the line number that contains the error, or NULL if NOT wanted
[out]pLineposContains the character position within the line where the error occurred, or NULL if NOT wanted
[out]pReasonDescribes the reason for the error, or NULL if NOT wanted
[in]maxReasonLengthMax length of pReason to return, if pReason is not NULL
[out]pSrcTextReturns the text of the line containing the error, or NULL if NOT wanted
[in]maxSrcTextLengthMax length of pSrcText to return, if pSrcText is not NULL
[out]pUrlReturns the URL of the XML document containing the last error, or NULL if NOT wanted
[in]maxUrlLengthMax length of pUrl to return, if pUrl is not NULL
[in]domRefReference to DOM class
Returns
SUCCESS or ERROR
int mdlXMLDom_getProperty ( XmlDomRef  domRef,
WChar const *  propertyName,
WChar *  propertyValue 
)

Get a property from the given DOM with the given name.

Returns
SUCCESS or ERROR
Parameters
[in]domRefReference to DOM class
[in]propertyNameName of property to get
[out]propertyValueReturned value for the given property value
int mdlXMLDom_getRootElement ( XmlNodeRef pNodeRef,
XmlDomRef  domRef 
)

Gets the root element (document element) from the given DOM.

Parameters
[out]pNodeRefreturned XML Root Element Node
[in]domRefReference to DOM class
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDom_getRootNode ( XmlNodeRef pNodeRef,
XmlDomRef  domRef 
)

Returns the given root node for the given DOM.

Parameters
[out]pNodeRefreturned root XML Node
[in]domRefReference to DOM class
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDom_getValidateError ( long *  pErrorCode,
long *  pFilepos,
long *  pLine,
long *  pLinepos,
WCharP  pReason,
int  maxReasonLength,
WCharP  pSrcText,
int  maxSrcTextLength,
WCharP  pUrl,
int  maxUrlLength,
XmlDomRef  domRef 
)

Returns the last validate error if one of the dom creation function fails.

Parameters
[out]pErrorCodeContains the error code of the last parse error, or NULL if NOT wanted
[out]pFileposContains the absolute file position where the error occurred, or NULL if NOT wanted
[out]pLineSpecifies the line number that contains the error, or NULL if NOT wanted
[out]pLineposContains the character position within the line where the error occurred, or NULL if NOT wanted
[out]pReasonDescribes the reason for the error, or NULL if NOT wanted
[in]maxReasonLengthMax length of pReason to return, if pReason is not NULL
[out]pSrcTextReturns the text of the line containing the error, or NULL if NOT wanted
[in]maxSrcTextLengthMax length of pSrcText to return, if pSrcText is not NULL
[out]pUrlReturns the URL of the XML document containing the last error, or NULL if NOT wanted
[in]maxUrlLengthMax length of pUrl to return, if pUrl is not NULL
[in]domRefReference to DOM class
Returns
SUCCESS or ERROR
int mdlXMLDom_insertElement ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
XmlNodeRef  beforeNodeRef,
int  tagValueType,
WChar const *  pTagName,
const void *  pTagValue 
)

Adds a new XML element to an existing XML DOM.

Parameters
[out]pNodeRefReturned newly created XML Element Node, can be NULL
[in]domRefReference to DOM class
[in]beforeNodeRefNode to become the next child of the new element
[in]tagValueTypeXMLDATATYPE_EMPTY, _T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
[in]pTagNameTag name for element node
[in]pTagValueTag value for element node or NULL for an empty element
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free. Pass NULL for tag value when using XMLDATATYPE_EMPTY.
See also
mdlXMLDomNode_free
int mdlXMLDom_load ( XmlDomRef  domRef,
int  fileSpecType,
WChar const *  pFileSpec,
WChar const *  pStorageSpec,
WChar const *  pStreamSpec 
)

Loads a XML Dom Class using the given file spec.

Parameters
[in]domRefLoads a previously created DOM
[in]fileSpecTypeFILESPEC_LOCAL, FILESPEC_URL, FILESPEC_LOCAL2
[in]pFileSpecFull file spec to generate
[in]pStorageSpecStorage (like directory)
[in]pStreamSpecStream (like file)
Returns
SUCCESS or ERROR
Remarks
domRef must be freed by calling mdlXMLDom_free
See also
mdlXMLDom_free
Remarks
fileSpecType(s) are defined in mdlxmltools.h
int mdlXMLDom_removeChild ( XmlDomRef  domRef,
XmlNodeRef  nodeRef 
)

Removes a node from an XML DOM.

Parameters
[in]nodeRefReference to XML Element Node class
[in]domRefReference to DOM class
Returns
SUCCESS or ERROR
int mdlXMLDom_replaceChild ( XmlDomRef  domRef,
XmlNodeRef  nodeToReplaceRef,
XmlNodeRef  replacementNodeRef 
)

Replaces a node in an XML DOM.

Parameters
[in]domRefReference to DOM class
[in]nodeToReplaceRefXML Node to be replaced
[in]replacementNodeRefReplacement XML Node
Returns
SUCCESS or ERROR
int mdlXMLDom_replaceOrAppendNodesByXPath ( XmlNodeRef pNodeRef,
XmlDomRef  domRef,
XmlNodeRef  startNodeRef,
WChar const *  pXpath,
int  tagValueType,
const void *  pTagValue,
int  appendFlags 
)

Adds a series of XML elements and/or an attribute to an existing XML DOM starting at startNode.

Parameters
[out]pNodeRefReturned newly created XML Element Node, can be NULL
[in]domRefReference to DOM class
[in]startNodeRefXML Node to be begin append nodes to
[in]tagValueTypeXMLDATATYPE_EMPTY, _T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
[in]pXpathxpath criteria to generate nodes for
[in]pTagValueTag value for element node or NULL for an empty element
[in]appendFlagsFlags for node creation/appending
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free. Pass NULL for tag value when using XMLDATATYPE_EMPTY.
See also
mdlXMLDomNode_free
int mdlXMLDom_save ( XmlDomRef  domRef,
int  fileSpecType,
WChar const *  pFileSpec,
WChar const *  pStorageSpec,
WChar const *  pStreamSpec,
WChar const *  pEncoding,
bool  bCompress,
bool  bOverwrite,
bool  bFormat 
)

Saves the give DOM out to the given file spec.

Parameters
[in]domRefReference to DOM class
[in]fileSpecTypemust be FILESPEC_LOCAL
[in]pFileSpecFull file spec to generate
[in]pStorageSpecStorage (like directory)
[in]pStreamSpecStream (like file)
[in]pEncodingEncoding
[in]bCompressReserved for future use, zip after saving?
[in]bOverwritetrue to overwrite existing file, false to fail if file already exists
[in]bFormatPretty Print (add indentation newlines) as saving
Returns
SUCCESS or ERROR
Remarks
fileSpecType(s) are defined in mdlxmltools.h
int mdlXMLDom_select ( XmlNodeListRef pNodeListRef,
XmlDomRef  sourceDomRef,
WChar const *  pXpath 
)

Returns a list of XML Nodes that match the given XPath Criteria.

Parameters
[out]pNodeListRefReturned XML nodelist
[in]sourceDomRefReference to DOM class
[in]pXpathXPath criteria
Returns
SUCCESS or ERROR
Remarks
pNodeListRef must be freed with mdlXMLDomNodeList_free
See also
mdlXMLDomNodeList_free
int mdlXMLDom_selectSingleNode ( XmlNodeRef pNodeRef,
XmlDomRef  sourceDomRef,
WChar const *  pXpath 
)

Selects the first Node that matches the XPath Criteria.

Returns
SUCCESS or ERROR
Parameters
[out]pNodeRefReturned first XML node that matches XPath criteria
[in]sourceDomRefReference to DOM class
[in]pXpathXPath criteria
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDom_setParameter ( XmlDomRef  domRef,
int  parameterType,
bool  parameterValue 
)

Sets parameters from the given DOM.

Returns
SUCCESS or ERROR
Parameters
[in]domRefReference to DOM class
[in]parameterTypeDOM_PARAMETER_* in mdlxmltools.h
[in]parameterValueSets parameterType for this DOM true/false
Remarks
parameterType(s) are defined in mdlxmltools.h
int mdlXMLDom_setProperty ( XmlDomRef  domRef,
WChar const *  propertyName,
WChar const *  propertyValue 
)

Sets a property from the given DOM to the given value.

Returns
SUCCESS or ERROR
Parameters
[in]domRefReference to DOM class
[in]propertyNameName of property to set
[in]propertyValueProperty value, as a string, for to set for propertyName
int mdlXMLDom_setRootElement ( XmlDomRef  domRef,
XmlNodeRef  nodeRef 
)

Sets the current node as the root (document) element for the given DOM.

Parameters
[in]domRefReference to DOM class
[in]nodeRefnode to set as root (document) element
Returns
SUCCESS or ERROR
int mdlXMLDom_setSchemaCache ( XmlDomRef  domRef,
XmlSchemaCacheRef  schemaCacheRef 
)

Associates the schema cache to the given XML DOM.

Parameters
[in]domRefXML Dom to set schema cache for
[in]schemaCacheRefSchema cache to associate with XML Dom
Returns
SUCCESS or ERROR
Remarks
int mdlXMLDom_validate ( XmlDomRef  domRef)

Validates the XML Dom against the previous set schema cache.

Parameters
[in]domRefXML Dom to validate
Returns
SUCCESS or ERROR
Remarks
int mdlXMLDom_validateAgainstSchema ( XmlDomRef  domRef,
WChar const *  pXMLNSTarget,
WChar const *  pSchemaFilename 
)

Validates the XML DOM against the given schema file name.

Parameters
[in]domRefXML Dom to validate
[in]pXMLNSTargetNamespace of associated schema to add
[in]pSchemaFilenameSchema filename to to use to validate XML Dom against
Returns
SUCCESS or ERROR
Remarks
int mdlXMLDom_validateAgainstSchemaCache ( XmlDomRef  domRef,
XmlSchemaCacheRef  schemaCacheRef 
)

Validates the XML Dom against the given schema cache.

Parameters
[in]domRefXML Dom to validate
[in]schemaCacheRefSchema cache to use to validate XML Dom against
Returns
SUCCESS or ERROR
Remarks
int mdlXMLDomAttr_getName ( WChar *  pAttrNodeName,
int *  pMaxChars,
XmlNodeRef  attrNodeRef 
)

Returns the name of the given XML Attribute Node.

Parameters
[in,out]pAttrNodeNameReturned name of the given XML Attribute
[in,out]pMaxCharsMax. number of chars of pAttrNodeName to return, actual number of chars in pAttrValueString returned
[in]attrNodeRefReference to Xml Attribute Node
Returns
SUCCESS or ERROR
int mdlXMLDomAttr_getValue ( WChar *  pAttrValueString,
int *  pMaxChars,
XmlNodeRef  attrNodeRef 
)

Returns the value of the given XML Attribute Node.

Parameters
[in,out]pAttrValueStringReturned value as a string of the given XML Attribute
[in,out]pMaxCharsMax. number of chars of pAttrValueString to return, actual number of chars in pAttrValueString returned
[in]attrNodeRefReference to Xml Attribute Node
Returns
SUCCESS or ERROR
int mdlXMLDomAttr_setValue ( XmlNodeRef  attrNodeRef,
WChar const *  pAttrValueString 
)

Sets the values of the XML Attribute Node.

Parameters
[in]attrNodeRefReference to Xml Attribute Node
[in]pAttrValueStringValue of attribute to set
Returns
SUCCESS or ERROR
int mdlXMLDomAttrList_free ( XmlNamedNodeMapRef  nodeMapRef)

Frees the attribute list.

Parameters
[in]nodeMapRefReference to Attribute list Node Map class
Returns
SUCCESS or ERROR
int mdlXMLDomAttrList_getChild ( XmlNodeRef pNodeRef,
XmlNamedNodeMapRef  nodeMapRef,
int  index 
)

Returns an XML Attribute node by index.

Parameters
[out]pNodeRefreturned XML Node
[in]nodeMapRefReference to Attribute list Node Map class
[in]indexthe index of the attribute to be retrieved
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomAttrList_getChildByName ( XmlNodeRef pNodeRef,
XmlNamedNodeMapRef  nodeMapRef,
WChar const *  pAttrName 
)

Returns an XML Attribute node by name.

Parameters
[out]pNodeRefreturned the XML Attribute node that matches name
[in]nodeMapRefReference to Attribute list Node Map class
[in]pAttrNameName of attribute to get
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomAttrList_getFirstChild ( XmlNodeRef pNodeRef,
XmlNamedNodeMapRef  nodeMapRef 
)

Returns the first attribute in the attribute list.

Parameters
[out]pNodeRefReturned first XML Atrribute node
[in]nodeMapRefReference to Attribute list Node Map class
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomAttrList_getNextChild ( XmlNodeRef pNodeRef,
XmlNamedNodeMapRef  nodeMapRef 
)

Returns the next attribute in the attribute list.

Returns
SUCCESS or ERROR
Parameters
[out]pNodeRefreturned next XML Atrribute node
[in]nodeMapRefReference to Attribute list Node Map class
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
long mdlXMLDomAttrList_getNumChildren ( XmlNamedNodeMapRef  nodeMapRef)

Returns the number of attributes in the attribute list.

Parameters
[in]nodeMapRefReference to Attribute list Node Map class
Returns
Number of attributes
int mdlXMLDomElement_addAttribute ( XmlNodeRef  nodeRef,
int  attributeType,
WChar const *  pAttributeName,
const void *  pAttributeValue 
)

Adds an XML attribute to the given XML Element Node.

Parameters
[in]nodeRefReference to Xml Element Node class
[in]attributeTypeAttribute DataType of pAttributeValue to add, XMLDATATYPE_EMPTY, _T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
[in]pAttributeNameAttribute name to add
[in]pAttributeValueAttribute value to add
Returns
SUCCESS or ERROR
Remarks
Pass NULL for tag value when using XMLDATATYPE_EMPTY.
See also
mdlXMLDomElement_addAttributeUsingNamespace
int mdlXMLDomElement_addAttributeUsingNamespace ( XmlDomRef  domRef,
XmlNodeRef  nodeRef,
int  attributeType,
WChar const *  pNamespaceURI,
WChar const *  pAttributeName,
const void *  pAttributeValue 
)

Adds an XML attribute to the given XML Element Node using namespaces.

Parameters
[in]domRefReference to XML DOM class
[in]nodeRefReference to Xml Element Node class
[in]attributeTypeAttribute DataType of pAttributeValue to add, XMLDATATYPE_EMPTY, _T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
[in]pNamespaceURIAttribute Namespace
[in]pAttributeNameAttribute name to add
[in]pAttributeValueAttribute value to add
Returns
SUCCESS or ERROR
Remarks
Pass NULL for tag value when using XMLDATATYPE_EMPTY.
See also
mdlXMLDomElement_addAttribute
int mdlXMLDomElement_appendAttributeNode ( XmlNodeRef  nodeRef,
XmlNodeRef  attributeNodeRef 
)

Adds an XML attribute to the given XML Element Node.

Parameters
[in]nodeRefReference to Xml Element Node class
[in]attributeNodeRefReference to Xml Attribute Node class
Returns
SUCCESS or ERROR
Remarks
Use this function after mdlXMLDom_createNode to insert a namespaced Attribute
int mdlXMLDomElement_appendChild ( XmlNodeRef  nodeToAppendAfterRef,
XmlNodeRef  nodeToAppendRef 
)

Appends a XML Node as a Child to the give XML Element Node.

Parameters
[in]nodeToAppendAfterRefXML Node to append to
[in]nodeToAppendRefXML Node to append
Returns
SUCCESS or ERROR
int mdlXMLDomElement_getAllAttributes ( XmlNamedNodeMapRef pNodeMapRef,
XmlNodeRef  nodeRef 
)

Returns an XML Named Nop Map with all attributes for the given XML Element.

Parameters
[in]pNodeMapRefReturned XML Node Map with all attributes
[in]nodeRefReference to XML Element Node class
Returns
SUCCESS or ERROR
Remarks
pNodeMapRef must be freed usint mdlXMLDomAttrList_free
See also
mdlXMLDomAttrList_free
int mdlXMLDomElement_getAttribute ( void *  pValue,
int *  pMaxChars,
XmlNodeRef  nodeRef,
WChar const *  pAttributeName,
int  attributeType 
)

Returns the attribute value of the given name on the given XML element.

Parameters
[in,out]pValueReturned value of named attribute returned as the attribute type
[in,out]pMaxCharsMax. number of chars of pValue to return, actual number of chars in pValue returned
[in]nodeRefReference to Xml Element Node class
[in]pAttributeNameAttribute name to get value for
[in]attributeTypeXMLDATATYPE_T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
Returns
SUCCESS or ERROR
Remarks
attributeType(s) are defined in mdlxmltools.h
This function will return SUCCESS if the attribute is missing, use mdlXMLDomElement_getAttributeExt
for a similar function that can return an ERROR if the attribute is missing.
See also
mdlXMLDomElement_getAttributeExt
int mdlXMLDomElement_getAttributeExt ( void *  pValue,
int *  pMaxChars,
XmlNodeRef  nodeRef,
WChar const *  pAttributeName,
int  attributeType,
bool  bFailIfAttributeMissing 
)

Returns the attribute value of the given name on the given XML element.

Parameters
[in,out]pValueReturned value of named attribute returned as the attribute type
[in,out]pMaxCharsMax. number of chars of pValue to return, actual number of chars in pValue returned
[in]nodeRefReference to Xml Element Node class
[in]pAttributeNameAttribute name to get value for
[in]attributeTypeXMLDATATYPE_T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
[in]bFailIfAttributeMissingIf true, returns ERROR, if the specified attribute does not exist
Returns
SUCCESS or ERROR
Remarks
attributeType(s) are defined in mdlxmltools.h
This method extends mdlXMLDomElement_getAttribute by allowing
control over the return value, if the attribute is missing.
See also
mdlXMLDomElement_getAttribute
int mdlXMLDomElement_getValue ( void *  pValue,
int *  pMaxChars,
XmlNodeRef  nodeRef,
int  attributeType 
)

Returns the text value for the given XML Element.

Parameters
[in,out]pValueReturned value of named attribute returned as the attribute type
[in,out]pMaxCharsMax. number of chars of pValue to return, actual number of chars in pValue returned
[in]nodeRefReference to Xml Element Node class
[in]attributeTypeXMLDATATYPE_T32, _UT32, _STRG, _WIDESTRG, _BOOLEAN, _DATETIME
Returns
SUCCESS or ERROR
Remarks
attributeType(s) are defined in mdlxmltools.h
int mdlXMLDomElement_removeAttribute ( XmlNodeRef  nodeRef,
WChar const *  pAttributeName 
)

Remove the specified XML attribute from the given XML Element Node.

Parameters
[in]nodeRefReference to Xml Element Node class
[in]pAttributeNameAttribute name to add
Returns
SUCCESS or ERROR
Remarks
Pass NULL for tag value when using XMLDATATYPE_EMPTY.
int mdlXMLDomElement_setValue ( XmlNodeRef  nodeRef,
WChar const *  pValueString 
)

Set the given XML Element value to be pValue.

Parameters
[in]pValueStringValue to set
[in]nodeRefReference to Xml Element Node class
Returns
SUCCESS or ERROR
int mdlXMLDomNode_cloneNode ( XmlNodeRef pClonedNodeRef,
XmlNodeRef  nodeRef,
bool  deepClone 
)

Clones the given XML Node.

Parameters
[out]pClonedNodeRefreturned cloned XML node
[in]nodeRefReference to Xml Node class
[in]deepClonetrue for deep clone, false for shallow clone
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomNode_free ( XmlNodeRef  nodeRef)

Frees the XML Dom Node.

Parameters
[in]nodeRefReference to Xml Node class
Returns
SUCCESS or ERROR
int mdlXMLDomNode_getChildNodes ( XmlNodeListRef pNodeListRef,
XmlNodeRef  nodeRef 
)

Returns a XML node list of child nodes of the given XML Node.

Parameters
[out]pNodeListRefreturned the next XML node at index
[in]nodeRefReference to Xml Node class
Returns
SUCCESS or ERROR
Remarks
pNodeListRef must be freed by calling mdlXMLDomNodeList_free
See also
mdlXMLDomNodeList_free
int mdlXMLDomNode_getName ( WChar *  pNodeName,
int *  pMaxChars,
XmlNodeRef  nodeRef 
)

Gets the node name of the current Xml Node.

Parameters
[in,out]pNodeNameReturned node name
[in,out]pMaxCharsMax. number of chars pNodeName to return, actual number of chars in pNodeName returned
[in]nodeRefReference to Xml Node class
Returns
SUCCESS or ERROR
int mdlXMLDomNode_getNodeType ( long *  pNodeType,
XmlNodeRef  nodeRef 
)

Returns the node type for the given XML Node.

Parameters
[in]pNodeTypeReturned Node Type
[in]nodeRefReference to XML Node class
Returns
SUCCESS or ERROR
int mdlXMLDomNode_getParentNode ( XmlNodeRef parentNodeRef,
XmlNodeRef  nodeToGetParentRef 
)

Gets the parent node of the given element.

Parameters
[in]parentNodeRefReturned Parent Node
[in]nodeToGetParentRefXML Node to be replaced
Returns
SUCCESS or ERROR
Remarks
parentNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomNode_getValue ( WChar *  pValueString,
int *  pMaxChars,
XmlNodeRef  nodeRef 
)

Returns the value of given XML Node.

Parameters
[in,out]pValueStringReturned value of named attribute returned as the attribute type
[in,out]pMaxCharsMax. number of chars of pValueString to return, actual number of chars in pValueString returned
[in]nodeRefReference to XML Node class
Returns
SUCCESS or ERROR
int mdlXMLDomNode_getXmlText ( WChar *  pValueString,
int *  pMaxChars,
XmlNodeRef  nodeRef 
)

Returns the XML Text of the given XML Node.

Parameters
[in,out]pValueStringReturned XML Text
[in,out]pMaxCharsMax. number of chars in pValueString to return, actual number of chars (not including NULL) in pValueString returned.
[in]nodeRefReference to Xml Node class
Returns
SUCCESS or ERROR
bool mdlXMLDomNode_hasChildNodes ( XmlNodeRef  nodeRef)

Returns true if the given XML Node has child nodes.

Parameters
[in]nodeRefReference to Xml Node class
Returns
true or false
int mdlXMLDomNode_insertBefore ( XmlNodeRef  nodeBeforeRef,
XmlNodeRef  nodeToInsertRef 
)

Inserts XML node before another XML Node.

Returns
SUCCESS or ERROR
Parameters
[in]nodeBeforeRefnode before which we insert
[in]nodeToInsertRefnode to insert
int mdlXMLDomNode_replaceChild ( XmlNodeRef  parentNodeRef,
XmlNodeRef  nodeToReplaceRef,
XmlNodeRef  replacementNodeRef 
)

Replaces a node in an XML DOM.

Parameters
[in]parentNodeRefReference to Parent Node of child to be replaced
[in]nodeToReplaceRefXML Node to be replaced
[in]replacementNodeRefReplacement XML Node
Returns
SUCCESS or ERROR
int mdlXMLDomNode_select ( XmlNodeListRef pNodeListRef,
XmlNodeRef  sourceNodeRef,
WChar const *  pXpath 
)

Returns a list of XML Nodes that matches the given XPath Criteria.

Parameters
[out]pNodeListRefReturned XML Node List
[in]sourceNodeRefReference to XML node
[in]pXpathXPath criteria
Returns
SUCCESS or ERROR
Remarks
pNodeListRef must be freed with mdlXMLDomNodeList_free
See also
mdlXMLDomNodeList_free
int mdlXMLDomNode_selectSingleNode ( XmlNodeRef pNodeRef,
XmlNodeRef  sourceNodeRef,
WChar const *  pXpath 
)

Returns first XML NOde that matches the given XPath Criteria.

Parameters
[out]pNodeRefreturned first XML node that matches XPath criteria
[in]sourceNodeRefReference to XML node
[in]pXpathXPath criteria
Returns
SUCCESS or ERROR
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomNode_setValue ( XmlNodeRef  nodeRef,
WChar const *  pValueString 
)

Sets the value for the given XML Node.

Parameters
[in]nodeRefReference to XML Node class
[in]pValueStringValue to set the current node to
Returns
SUCCESS or ERROR
void mdlXMLDomNode_verboseElement ( XmlNodeRef  nodeRef)

Prints out the XML Element Node Name for debugging purposes only.

Parameters
[in]nodeRefReference to Xml Node class
Returns
None
int mdlXMLDomNodeList_free ( XmlNodeListRef  nodeListRef)

Frees the given XML Node List.

Parameters
[in]nodeListRefReference to Node List class
Returns
SUCCESS or ERROR
int mdlXMLDomNodeList_getChild ( XmlNodeRef pNodeRef,
XmlNodeListRef  nodeListRef,
long  index 
)

Returns the XML Child Node at the given index in the XML Node List.

Returns
SUCCESS or ERROR
Parameters
[out]pNodeRefreturned the next XML node at index
[in]nodeListRefReference to Node List class
[in]indexthe index of the node list to be retrieved
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomNodeList_getFirstChild ( XmlNodeRef pNodeRef,
XmlNodeListRef  nodeListRef 
)

Returns the first XML Child Node in given XML Node List.

Returns
SUCCESS or ERROR
Parameters
[out]pNodeRefreturned first XML node in list
[in]nodeListRefReference to Node List class
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomNodeList_getNextChild ( XmlNodeRef pNodeRef,
XmlNodeListRef  nodeListRef 
)

Returns the next XML Child Node in given XML Node List.

Returns
SUCCESS or ERROR
Parameters
[out]pNodeRefreturned the next XML node in list
[in]nodeListRefReference to Node List class
Remarks
pNodeRef must be freed by calling mdlXMLDomNode_free
See also
mdlXMLDomNode_free
int mdlXMLDomNodeList_getNextChildElement ( XmlNodeRef childNodeP,
WChar *  childNodeNameP,
XmlNodeListRef childNodeListP,
XmlNodeRef  parentNode 
)

Returns the next child element from the current XML Node List.

Parameters
[in,out]childNodePXML Node to initialize
[in,out]childNodeNamePReturned Element Tag Name of childNodeP, or NULL
[in,out]childNodeListPXML Node List to initialize
[in,out]parentNodeParent XML Node to iterate Child Nodes
See also
mdlXMLDomNodeList_free
Returns
SUCCESS or ERROR
Remarks
Should only be used in conjunction with mdlXMLDomNodeList_initProcessChildren Automatically frees the previous child Node before getting the next child Automatically frees the XML Node List after last child is returned No need to free childNodeP or childNodeListP
See also
mdlXMLDomNodeList_initProcessChildren
long mdlXMLDomNodeList_getNumChildren ( XmlNodeListRef  nodeListRef)

Returns the number in given XML Node List.

Parameters
[in]nodeListRefReference to Node List class
Returns
Number of XML Nodes
void mdlXMLDomNodeList_initProcessChildren ( XmlNodeRef childNodeP,
XmlNodeListRef childNodeListP 
)

Initializes a XML Node and XML Node List for use with mdlXMLDomNodeList_getNextChildElement.

Parameters
[in,out]childNodePXML Node to initialize
[in,out]childNodeListPXML Node List to initialize
Remarks
Should only be used in conjunction with mdlXMLDomNodeList_getNextChildElement
See also
mdlXMLDomNodeList_getNextChildElement
int mdlXMLDomNodeList_select ( XmlNodeListRef pNodeListRef,
XmlDomRef  domRef,
WChar const *  pXpath 
)

Returns a list of XML Nodes that match the given XPath Criteria.

Parameters
[out]pNodeListRefReturned XML Node List
[in]domRefReference to XML DOM class
[in]pXpathXPath criteria
Returns
SUCCESS or ERROR
Remarks
pNodeListRef must be freed with mdlXMLDomNodeList_free
See also
mdlXMLDomNodeList_free
int mdlXMLDomNodeList_traverse ( XmlNodeListRef  nodeListRef,
int  options,
int(*)(XmlNodeRef node, void *userArgs)  userFuncNodeListTraverse,
void *  userArg 
)

Transverses the given XML Dom Node List and calls the user function for each XML Node in the list.

Parameters
[in]nodeListRefReference to Node List class
[in]optionsTransverse Options, reserved for future use
[in]userFuncNodeListTraverseUsed call-back function to be called for each XML Node in XML Node List
[in]userArgUser definable argument to pass onto UserFuncNodeListTraverse function
Returns
SUCCESS or ERROR
Remarks
(userFuncNodeListTraverse)(XmlNodeRef node, void userArgs)

Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.