Skip navigation.

ATMI C Function Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


tpxmltofml(3c)

Name

tpxmltofml()—Converts XML data to FML buffers

Synopsis

#include <fml.h>
int tpxmltofml (char *xmlbufp, char *vfile, FBFR **fmlbufp, char **rtag, long flags)

Description

This function is used to convert XML data to FML buffers. It supports the following valid arguments:

xmlbufp

This argument is a pointer to valid XML typed buffer input.

vfile

The argument is the fully qualified path name of an XML Schema file used to validate XML input. To use this argument, you must set the TPXPARSNSPACE and TPXPARSDOSCHE flags and not set the TPXPARSNEVER flag.

fmlbufp

This argument is a pointer to an output FML typed buffer created from the input XML.

rtag

This argument is a pointer that stores the root element name from the input XML document.

flags

This argument is used in XML to FML/FM32L conversion to map to a Tuxedo 9.x subset of Xerces parser classes (see, XercesParser 2.5 documentation). The following is a list of Tuxedo 9.x valid Xerces parser flags:

TPXPARSNEVER

Sets setValidationScheme to Val_Never. The parser will not report Schema validation errors.

TPXPARSALWAYS

Sets setValidationScheme to Val_Always. The parser will always report Schema validation errors.

Note: TPXPARSNEVER takes precedent over TPXPARSALWAYS if both arguments are used at the same time.

TPXPARSSCHFULL

Sets setValidationSchemaFullChecking to true. This flag allows the user to turn full Schema constraint checking on/off. Only takes effect if Schema validation is enabled. If turned off, partial constraint checking is done. Full schema constraint checking includes those checking that may be time-consuming or memory intensive. Currently, particle unique attribution constraint checking and particle derivation restriction checking are controlled by this option.

TPXPARSCONFATAL

Sets setValidationConstraintFatal to true. This flag allows users to set the parser's behavior when it encounters a validation constraint error. If set to true, and the parser will treat validation error as fatal and will exit depends on the state of getExitOnFirstFatalError. If false, then it will report the error and continue processing.

TPXPARSNSPACE

Sets setDoNamespaces to true. This flag allows users to enable or disable the parser's namespace processing. When set to true, parser starts enforcing all the constraints and rules specified by the NameSpace specification.

TPXPARSDOSCH

Sets setDoSchema to true. This flag allows users to enable or disable the parser's schema processing. When set to false, parser will not process any schema found.

Note: If set to true, namespace processing must also be turned on.

TPXPARSEREFN

Sets setCreateEntityReferencNodes to false. This flag allows the user to specify whether the parser should create entity reference nodes in the DOM tree being produced. When the create flag is true, the parser will create EntityReference nodes in the DOM tree. The EntityReference nodes and their child nodes will be read-only. When the create flag is false, no EntityReference nodes will be created.The replacement text of the entity is included in either case, either as a child of the Entity Reference node or in place at the location of the reference.

TPXPARSNOEXIT

Sets setExitOnFirstFatalError to false. This flag allows users to set the parser's behavior when it encounters the first fatal error. If set to true, the parser will exit at the first fatal error. If false, then it will report the error and continue processing.

TPXPARSNOINCWS

Sets setIncludeIgnorableWhitespace to false. This flag allows the user to specify whether a validating parser should include ignorable whitespaces as text nodes. It has no effect on non-validating parsers which always include non-markup text.

When set to false, all ignorable whitespace will be discarded and no text node is added to the DOM tree.

TPXPARSCACHESET

Sets setcacheGrammarFromParse to true. This flag allows users to enable or disable caching of grammar when parsing XML documents. When set to true, the parser will cache the resulting grammar for use in subsequent parses. If the flag is set to true, the Use cached grammar flag will also be set to true.

TPXPARSCACHERESET

Resets resetCachedGrammarPool. Resets the documents vector pool and release all the associated memory back to the system.

When parsing a document using a DOM parser, all memory allocated for a DOM tree is associated to the DOM document.

If you do multiple parse using the same DOM parser instance, then multiple DOM documents will be generated and saved in a vector pool. All these documents (and thus all the allocated memory) won't be deleted until the parser instance is destroyed.

If you do not need these DOM documents anymore and do not want to destroy the DOM parser instance at this moment, then you can call this method to reset the document vector pool and release all the allocated memory back to the system. It is an error to call this method if you are in the middle of a parse (for example, a mid progressive parse).

Return Values

Upon success, tpxmltofml () returns a 0. This function returns -1 on error and sets tperrno to indicate the error condition.

Errors

The function may fail for the following reasons.

[TPEINVAL]

Either fml32bufp or xmlbufp is not a valid typed buffer, or parser has problems understanding the input.

[TPESYSTEM]

A Tuxedo system error has occurred. The exact nature of the error is written to userlog(3c). This will also indicate when a conversion to FML was unable to be done. In that instance error detail info will be added to the userlog.

[TPEOS]

An operating system error has occurred. A numeric value representing the system call that failed is available in Uunixerr.

SEE ALSO

 

Skip navigation bar  Back to Top Previous Next