p r o d u c t s

2.1.2
Basic Edition: Free
Standard Edition: $19.95

Plugins
Minimum Requirements
Download
Buy Now
What is the XML Library?
The XML Library allows users of Revolution 2.0 (or higher) to read and manipulate XML documents, using methods that are fully compliant with the W3C specifications for XML (which can be found at http://www.w3.org/TR/REC-xml).

The XML Library comes in two forms:

  • Basic Edition: A freeware version that provides the ability to read and parse multiple XML documents. This version does not provide writing capabilities (i.e. you can't change attribute values, create or delete nodes, etc.) or DTD support and the library comes as a locked stack. NOTE: The Basic Edition is for non-commerical use ONLY. If you want to use this library with a commercial product, you will need to purchase the Standard Edition (see below). To download the Basic Edition, please click on the Download link in the Navigator.
  • Standard Edition: A commercial version that provides the ability to read, parse and write multiple XML documents. This version does not come with DTD support. The library comes as an unlocked stack so you can modify the scripts for custom behaviors. To purchase the Standard Edition, please click on the Buy Now link in the Navigator.
If you want to read the documentation, see how the STS XML Library compares with the Revolution revXML.DLL, or want to know about the new features that have been added since the previous version, click on the appropriate link in the Navigator.

Ten Advantages the STS XML Library Has Over Revolution's revXML.DLL
Although there is more detail by clicking the How Does It Compare With the Revolution revXML.dll link, here are ten advantages that the XML Library has over the revXML.DLL:
  1. It's an all-Transcript solution, so there are no ancillary files to deliver with your application (the library can be easily made a substack of your mainstack).

  2. As an all-Transcript solution, if you want to adjust how things get parsed or add your own parsing rules that piggyback on the ones I've written, you're free to do so.

  3. You can manipulate nodes other than 'element' nodes - comments, CDATA, processing instructions, etc.

  4. The XML library works hard to maintain original whitespace in a parsed XML document; for example if you have a nicely readable XML doc that you run through the revXML.DLL to change an attribute of a tag and then write the data back out, it's an unreadable mess. With the XML Library it looks just like it did at the beginning, just with the attribute changed.

  5. The XML Library will normalize data retrieved from a node; revXML.DLL won't do that.

  6. The documentation for the XML Library is far and away more comprehensive than what comes with the revXML.DLL.

  7. The XML Library will allow you to actually delete an attribute from an element tag (stsXML_DeleteAttribute).

  8. You can also search through XML and return results, either by searching by attribute value or by data (stsXML_FindNodesByAttribute, stsXML_FindNodesByData)

  9. You can retrive certain XML trees into an array directly, allowing more flexibility in manipulation (stsXML_ChildrenToArray)

  10. You can add, insert, and manipulate children of an existing node; the revXML.DLL doesn't let you insert - you can only add at the end of a list of children.
There are, of course, reasons to use the revXML.DLL instead of the XML Library (it supports DTDs and SOAP, and was written in C so it is a lot faster (especially on large XML files)), but if you have smallish (<200K) XML documents, the XML Library gives more flexibility and bug fixes/features are implemented faster than can be expected from Runtime Revolution.

XML Library Methods
The functions (or “methods”) available in the XML Library are as follows:

Loading Methods Basic Standard
stsXML_LoadData This method loads XML data into the global array gSTSXML_Data and verifies that it is well-formed.
Document Management Methods
stsXML_CreateDocument This method creates a new XML document in the global array gSTSXML_Data.  
stsXML_DeleteDocument This method deletes an XML document from the global array gSTSXML_Data.
stsXML_GetDocuments This method retrieves a list of XML documents from the global array gSTSXML_Data.
Data/Text Methods
stsXML_ChildrenToArray This method retrieves the text contents from all the children of a node you specify, and returns it as an array.
stsXML_GetNodeData This method retrieves the TEXT or CDATA contents from an element node.
stsXML_GetCDATA
(deprecated)
This method retrieves the CDATA contents of a CDAT node.
stsXML_GetText
(deprecated)
This method retrieves the text contents of a TEXT node.
Attribute Methods
stsXML_AttributesToArray This method retrieves all of the attributes from a specified node and returns them in an array.
stsXML_CountAttributes This method returns the number of attributes owned by a node.
stsXML_CreateAttribute This method creates a new attribute for a node.  
stsXML_DeleteAttribute This method deletes an attribute from a node.  
stsXML_GetAttribute This method retrieves the value of an attribute from a node.
stsXML_GetAttributes This method retrieves the list of attributes owned by a node.
stsXML_HasAttribute This method determines whether a node has a specific named attribute.
stsXML_SetAttribute This method sets the value of an attribute of a node.  
Search Methods
stsXML_FindNodesByAttribute This method locates all of the element nodes in a section of a document that has a specific attribute that matches a specific search string.
stsXML_FindNodesByData This method locates all of the element nodes in a section of a document that has TEXT or CDATA contents that match a specific search string.
Node Methods
stsXML_CreateNode This method creates a new node in the global array gSTSXML_Data, either as a sibling or child of an existing node.  
stsXML_DeleteNode This method deletes a node from the global array gXMLData.  
stsXML_GetNodeXML This method retrieves the raw XML for a specified node (and optionally its children).
stsXML_GetNodeName This method retrieves the name node property from a node.
stsXML_GetNodeType This method retrieves the type node property from a node.
stsXML_GetRoot This method retrieves the root node property from a document node.
stsXML_IsEmptyElement This method determines whether an ELEM node is an Empty Element or not.
Parent/Child Methods
stsXML_AppendChild This method adds a child node to an ELEM node.  
stsXML_CountChildren This method returns the number of child nodes owned by a node.
stsXML_CountNamedChildren This method returns the number of child nodes of a node that have a specific name.
stsXML_GetChildren This method retrieves a list of child nodes of a node, optionally of a specific node type.
stsXML_GetFirstChild This method retrieves the node ID of the first child owned by a node.
stsXML_GetNamedChildren This method returns a list of child nodes of a node that have a specific name.
stsXML_GetLastChild This method retrieves the node ID of the last child owned by a node.
stsXML_GetNextSibling This method retrieves the node ID of the next sibling of a node.
stsXML_GetParent This method returns the node ID of the parent of a node.
stsXML_GetPreviousSibling This method retrieves the node ID of the previous sibling of a node.
stsXML_HasChildren This method determines whether nodeID has children or not.

In addition to the methods for manipulating XML described above, the XML Library also comes with a dozen "utility" methods that can help the developer in working with XML:

Utility Methods Basic Standard
stsXML_clearCallback This method removes the special trapping of errors provided by xml_setCallback.
stsXML_dump This method returns as text the entire XML tree, with node numbers attached. Very useful for debugging purposes.
stsXML_expand This method recreates a "chunk" of XML content, simply by providing a parent node identifier.
stsXML_expandPaths This method returns a list of node paths that represent all of the descendents of the specified node.
stsXML_getNodeID(s) This method returns the node ID for every node path supplied to this method.
stsXML_getNodePath(s) This method returns the node path for every node ID supplied to this method.
stsXML_isDocument This method determines whether a document identifier is valid.
stsXML_isNode This method determines whether a node identifier is valid.
stsXML_isType This method determines whether a node type code is valid.
stsXML_libVersion This method returns the version, modified date and type of the XML Library currently running.
stsXML_normalize This method will normalize a string, compressing multiple spaces into one, etc.
stsXML_prettyPrint This method outputs a formatted block of XML along with associated node ID numbers.
stsXML_replaceEntities This method replaces a specific set of character entities with their proper replacement.
stsXML_reset This method completely reinitializes the gSTSXML_Data array.
stsXML_setCallback This method sets up a callback message to be triggered whenever a parsing error is encountered.
stsXML_validateNode This method validates the contents of an XML data string against a node type to determine if the string is well-formed.

News and Rumors Products Services Developer Resources Contact STS About STS