XMLCreator

( )
4 Votes

The XMLCreator class is a class designed to assist in creating XML-documents. It wraps the MXXMLWriter30 class from microsoft and produces in-memory XML-documents as well as documents saved to disk.
The great thing about this class is that it takes care of the encoding of special characters etc.

Download Donate License

Be the first to leve a comment or ask a question about the code!

Requires:

"Microsoft XML, v3.0" or later
"Microsoft ActiveX Data Objects 2.5 Library" or later

Here is an example how to use it:

The interface:

  • Encoding as string
    Property for setting and getting the encoding used in the resulting XML-document. Default is UTF-16.
  • Standalone as boolean
    Property for enabeling and disableing the standalone attribute in the XML-declaration. Default is True.
  • OutputEscaping as boolean
    Property for enabling and disableing the output escaping. Default is True.
  • Indent as boolean
    Property for enableing and disableing indentation of the resulting XML-document. Default is True.
  • XMLDeclaration as boolean
    Property for enableing and disableing the XML-declaration in the resulting XML-document. Default is True .
  • NewDocument()
    Starts a new document.
  • EndDocument()
    Ends a document.
  • NewElement(ElementName as String)
    Creates a new XML-element with the name ElementName.
  • SetElementValue(Value as string)
    Sets the value in the current XML-element.
  • AddElement()
    Adds a created element to the XML-document.
  • EndElement()
    Ends an added element.
  • AddAttribute(AttributeName as string, AttributeValue as string)
    Adds an attribute to a created element.
  • GetDocument() as string
    Returns the XML-document as a string.
  • SaveDocument(FileName as string)
    Saves the XML-document to a file.

Do you want your organization to take off
or are you happy as long as it doesn't drop?
With participation and motivated staff you organization can get airborne!

Last update Tuesday, August 07, 2007
Copyright © 2006 Datomatic. All rights reserved

Powered by umbraco