BizTalk Utilities CV ,   Jobs ,   Code library
 
Home Page


Add/Edit your code items
Search the code library
Browse for the code library


Uncategorized
nodeset of child templates using document()
Converting INI files to XML
Fullxml 2
Sorting the results and use the Axis
TreeMaker
XMLEditor - WebClipping
WDDX Parser
Templx: x++ IDE Released!
XppEngCOM: COM implementation of x++ interpreter
Backup Outlook mail as XML
Grouping and Summing the values in XML
WDDX Parser (updated bug)
DIME Parser and Generator (C#)
Flash menu using XML
Virtual Directory Utilities for IIS(C#)
ComSerialization
Re: Max() function
Stop Tailoring, Create Generic!!!
Introduction to WAP Push
Add xml binding to select list


 
 

<< System.XMLWCF, WS, SOAP >>


By Grant Phillips
First Posted 03/21/2002
Times viewed 262

XML Helper functions in Visual Basic


Summary Handy VB functions for manipulating XML.

' Create an XML node (as a string) with some attributes, eg.
' strXML = XMLCreate( Person, Array( ma(Name, Bob Smith), ma(Age, 36) ) )
Public Function XMLCreate( _
ByVal strNodeName As String, _
Optional varAttributes As Variant) As String

' Get the value of an xml attribute from an XML Node
Public Function XMLGetAttributeValue( _
ByRef xmlNode As IXMLDOMNode, _
ByVal strAttributeName As String, _
Optional ByVal varDefault As Variant) As Variant

' Get the boolean value of an xml attribute from an XML Node
Public Function XMLGetAttributeValueBoolean( _
ByRef xmlNode As IXMLDOMNode, _
ByVal strAttributeName As String, _
Optional ByVal blnDefault As Boolean = False) As Boolean

' Get the long value of an xml attribute from an XML Node
Public Function XMLGetAttributeValueLong( _
ByRef xmlNode As IXMLDOMNode, _
ByVal strAttributeName As String, _
Optional ByVal lngDefault As Long = 0) As Long

' Create and Load an XML Document from either a string or a file, eg.
' Set xmlDoc1 = XMLLoadDoc( sample.xml )
' Set xmlDoc2 = XMLLoadDoc( <Root>Hello</Root> )
Public Function XMLLoadDoc(ByVal strXML As String) As DOMDocument

Additional information

Further additional information


Rate this article on a scale of 1 to 10 (0 votes, average 0)

Your vote :  

<< System.XMLWCF, WS, SOAP >>





Leave a comment for this article
Your name
Your email (optional)
Your comment
Optional: Upload an attachment
Enter the code shown:

 
 

    Email TopXML