Error getting tags :
error 404Error getting tags :
error 404 revCreateXMLTreeFromFile | revDocs | RunRev
Welcome Guest (Log in)
Product Edition
Version
revCreateXMLTreeFromFile
Basics
Expander triangle
Type
Function
Syntax
revCreateXMLTreeFromFile(filePath,parseBadData,createTree,sendMessages)
Introduced
2.0
Environment
Desktop, Web and Server
Platform Support
MacOS,Mac OS X,Windows,Linux
Security
Disk
Summary
Reads an XML file, optionally creating an XML tree.
Examples

revCreateXMLTreeFromFile("New.xml",false,true,false)
if revCreateXMLTreeFromFile(it,true,true,false) then next repeat

Additional Comments
Expander triangle

Use the revCreateXMLTreeFromFile function to read the contents of an XML document and create an XML tree from it in memory.

Parameters:

The filePath is the name and location of a file containing XML text.

The parseBadData is true or false.

The createTree is true or false.

The sendMessages is true or false.

Value:

The revXMLCreateTreeFromFile function returns a tree ID which can be used to refer to the tree in other XML library commands and functions. The tree ID is always a positive integer. (If the createTree is false, the function returns zero.)

If the function encounters an error while parsing the file, it returns an error message beginning with "xmlerr".

Comments:

If the parseBadData is true, the revCreateXMLTreeFromFile function tries to parse XML data even if it is not well-formed. Otherwise, the function stops executing as soon as it encounters data that is not well-formed XML.

If the createTree is true, the function creates a tree structure in memory. Otherwise, the function simply parses the XML data without creating an XML tree.

If the sendMessages is true, the revXMLStartTree, revStartXMLNode, revStartXMLData, revEndXMLNode, and revXMLEndTree messages are sent while the file is being parsed. Otherwise, these messages are not sent.

If the revCreateXMLTreeFromFile function encounters an error, it returns an error message starting with "xmlerr".

Important! The revCreateXMLTreeFromFilefunction is part of the XML library. To ensure that the function works in a standalone application, you must include this custom library when you create your standalone. In the Inclusions section on the General screen of the Standalone Application Settings window, make sure "XML Library" is selected in the list of script libraries.

User Comments
Expander triangle
User thumbnail
benr_mc@cogapp.com
StarStarStarStarStar
Dec 2, 2010
Using this function with parse=false, and sendMessages=true, allows massive XML files to be parsed with less memory impact. Note a gotcha however: the messages are sent not to the object which invoked this function, but to the (current?) card.