Namespace: Consultingwerk.Util
Class 
XmlHelper Copy to Clipboard
Parent classes:
Inherits: Progress.Lang.Object

File:XmlHelper
Purpose:Provides supporting routines for XML Processing
Author(s):Mike Fechner / Consultingwerk Ltd.
Created:Thu Nov 08 16:17:13 CET 2012
Notes:Static methods only



Top Method Summary
Options Name Purpose
+ CHARACTER GetCharacterValueInNode (handle) Returns the CHARACTER Value of the Text node that is the first child of an XML Element
+ HANDLE GetChildByName (handle, character) Returns a X-NODEREF that points to the first child node of the given node with the given name
+ LONGCHAR GetLongcharValueInNode (handle) Returns the LONGCHAR Value of the Text node that is the first child of an XML Element
+ HANDLE InsertElementNode (handle, character) Adds an Element node to a X-NODEREF
+ InsertNodeAttribute (handle, character, character) Inserts an Attribute Node to an exiting XML Node
+ HANDLE InsertTextNode (handle, character) Adds a Text node to a X-NODEREF
+ HANDLE InsertTextNode (handle, longchar) Adds a Text node to a X-NODEREF
+ HANDLE InsertTextNode (handle, raw) Adds a base64-encoded Text node for RAW value to a X-NODEREF
+ LOGICAL IsWellFormed (longchar) Verifies of the physical structure of the passed in Longchar is a valid (well-formed) XML Document
+ CHARACTER Sanitize (character) Sanitizes the passed in Character value as an XML Document
+ LONGCHAR Sanitize (longchar) Sanitizes the passed in Longchar value as an XML Document

Top Constructor Summary
Options Name Purpose
# XmlHelper () Constructor for the XmlHelper class


Method Detail
Top

PUBLIC CHARACTER GetCharacterValueInNode (handle)

Purpose: Returns the CHARACTER Value of the Text node that is the first child
of an XML Element
Notes: Returns an Empty String when the node does not have a Text Child

Parameters:
phXmlNode HANDLE
The XML Element to return the text for
Returns CHARACTER
The CHARACTER Value
Top

PUBLIC HANDLE GetChildByName (handle, character)

Purpose: Returns a X-NODEREF that points to the first child node of the given
node with the given name
Notes: The caller is responsible for deleting the returned X-NODEREF

Parameters:
phParentNodeRef HANDLE
The X-NODEREF of the Parent
pcChildName CHARACTER
The name of the child node to be returned
Returns HANDLE
The X-NODEREF pointing to the requested child or ?
Top

PUBLIC LONGCHAR GetLongcharValueInNode (handle)

Purpose: Returns the LONGCHAR Value of the Text node that is the first child
of an XML Element
Notes: Returns an Empty String when the node does not have a Text Child

Parameters:
phXmlNode HANDLE
The XML Element to return the text for
Returns LONGCHAR
The LONGCHAR Value
Top

PUBLIC HANDLE InsertElementNode (handle, character)

Purpose: Adds an Element node to a X-NODEREF
Notes: The caller is responsible for cleaning up the created X-NODEREF

Parameters:
phParentNode HANDLE
The parent X-NODEREF
pcNodeName CHARACTER
The name of the node to add to the parent X-NODEREF
Returns HANDLE
The Element X-NODEREF
Top

PUBLIC InsertNodeAttribute (handle, character, character)

Purpose: Inserts an Attribute Node to an exiting XML Node
Notes:

Parameters:
phParentNode HANDLE
The parent X-NODEREF
pcAttributeName CHARACTER
The name of the attribute to add to the parent X-NODEREF
pcAttributeValue CHARACTER
The value of the attribute to add to the parent X-NODEREF
Top

PUBLIC HANDLE InsertTextNode (handle, character)

Purpose: Adds a Text node to a X-NODEREF
Notes: The caller is responsible for cleaning up the created X-NODEREF

Parameters:
phParentNode HANDLE
The parent X-NODEREF
pcText CHARACTER
The text to add to the parent X-NODEREF
Returns HANDLE
The Text X-NODEREF
Top

PUBLIC HANDLE InsertTextNode (handle, longchar)

Purpose: Adds a Text node to a X-NODEREF
Notes: The caller is responsible for cleaning up the created X-NODEREF

Parameters:
phParentNode HANDLE
The parent X-NODEREF
plcText LONGCHAR
The text to add to the parent X-NODEREF
Returns HANDLE
The Text X-NODEREF
Top

PUBLIC HANDLE InsertTextNode (handle, raw)

Purpose: Adds a base64-encoded Text node for RAW value to a X-NODEREF
Notes: The caller is responsible for cleaning up the created X-NODEREF

Parameters:
phParentNode HANDLE
The parent X-NODEREF
prValue RAW
The RAW value to encode and add to the parent X-NODEREF
Returns HANDLE
The Text X-NODEREF
Top

PUBLIC LOGICAL IsWellFormed (longchar)

Purpose: Verifies of the physical structure of the passed in Longchar is a
valid (well-formed) XML Document
Notes:

Parameters:
pcXmlString LONGCHAR
The Xml String to varify
Returns LOGICAL
Logical value indicating if the value contains a well-formed XML document
Top

PUBLIC CHARACTER Sanitize (character)

Purpose: Sanitizes the passed in Character value as an XML Document
Notes:

Parameters:
pcXmlString CHARACTER
The Xml String to sanitize
Returns CHARACTER
The sanitized XML String
Top

PUBLIC LONGCHAR Sanitize (longchar)

Purpose: Sanitizes the passed in Longchar value as an XML Document
Notes:

Parameters:
pcXmlString LONGCHAR
The Xml String to sanitize
Returns LONGCHAR
The sanitized XML String


Constructor Detail
Top

PROTECTED XmlHelper ()

Purpose: Constructor for the XmlHelper class
Notes: Disallow instance creation



©2006-2016 Consultingwerk Ltd.         info@consultingwerk.de         http://www.consultingwerk.de       26.08.2016 08:47:02