bBox_XPathInitializeFromText( mode; text {; options; namespaceValues} )

Parameters:

   mode:

      0 = translate carriage returns in source to new lines (equivalent to mode 2)

      1 = skip conversion of carriage returns (the FileMaker end-of-line marker) to new lines

      2 = skip translation of new lines in shell output to carriage returns

      3 = don't translate input or ouput line endings

   source: the XML source to be processed (tokenized)

   options: named libxml2 parser options to be passed to XPath parser (optional)

   namespaceValues: these must be pairs of return-delimited values:

      namespace prefix that will be used in XPath expression

      namespace URI, e.g. "http://www.w3.org/2005/Atom"


Result:


Error:

   bBox_LastError ("xpath")


Script Step:

   none

––––––––––

First appeared in: 

Examples in demo file: 16

Compatibility:   Client, macOS, Server, Ubuntu, WebDirect, WPE

––––––––––

Initialize the XPath environment and process the XML source. This is usually followed by a call to bBox_XPathEvaluate and bBox_XPathFinalize.

Check with bBox_LastError ("xpath") for any errors tokenizing the XML. If there are no errors, use the bBox_XPathEvaluate function to get the results of your XPath queries. if the RECOVER option is used, you may get error messages with an error number of 0.

Consider converting the line endings of the XML source from FileMaker’s default of carriage returns to use new lines (e.g,, use a mode value of 2). Otherwise, the error is will always be reported as occurring on line 1.

bBox uses the Gnome libxml2 library, version 2.9.5. XInclude substitution and external DTD support is enabled by default, but you can use the options parameter to change this. Options consist of a string of named options, delimited by comma or space. Pass "" as the option if you don’t want to use any parser options, otherwise the options preceeded by a bullet will be used.

BIG_LINES : Store big lines numbers in text PSVI field

COMPACT : compact small text nodes; no modification of the tree allowed afterwards (may crash if you try to modify the tree)

•DTDATTR : default DTD attributes

DTDLOAD : load the external subset

DTDVALID : validate with the DTD

HUGE : relax any hardcoded limit from the parser (may exhaust available memory)

IGNORE_ENC : ignore internal document encoding hint

NOBASEFIX : do not fixup XINCLUDE xml:base uris

NOBLANKS : remove blank nodes

NOCDATA : merge CDATA as text nodes

NODICT : Do not reuse the context dictionnary

NOENT : substitute entities

NOERROR : suppress error reports

NONET : Forbid network access

NOWARNING : suppress warning reports

NOXINCNODE : do not generate XINCLUDE START/END nodes

NSCLEAN : remove redundant namespaces declarations

OLD10 : parse using XML-1.0 before update 5

OLDSAX : parse using SAX2 interface before 2.7.0

•PEDANTIC : pedantic error reporting

•RECOVER : recover on errors

SAX1 : use the SAX1 interface internally

•XINCLUDE : Implement XInclude substitition

Your source text should not contain content that can’t be converted to the UTF-8 character encoding. Even so, at least two UTF-8 characters seem to be problematic when in the XML content:

  • right single quotation mark
  • non-breaking space

If the RECOVER option is used (one of the defaults) it is possible your call may generate errors, but will still succesfully parse the XML tree.

––––––––––

bBox Functions

bBox Wiki