TutXmlCreateStatic


Name

TutXmlCreateStatic — create an XML object from a static buffer

Synopsis

T_XML TutXmlCreateStatic(xml_str) 
T_XML xml_str; 

Arguments

xml_str — an XML string that must remain valid for the life of the XML object.

Return Values

New XML object if successful, NULL otherwise.

Diagnostics

If TutXmlCreateStatic fails, it returns NULL and sets the global SmartSockets error number to this:

Description

TutXmlCreateStatic creates a new XML object from a static XML string. This function differs from TutXmlCreate because it does not copy the xml_str. The xml_str must remain valid (allocated and accessible) for the life of the newly created XML object.

Caution

The returned XML object must be destroyed when no longer needed by calling TutXmlDestroy.

See Also

TutXmlCreate, TutXmlDestroy

Examples

This example creates a new XML object and initializes it to a valid XML string. The value of xml_str must remain valid for the duration of the XML object that is returned by TutXmlCreateStatic.

T_STR xml_str = "<data><data1><temp=\"hot\"/></data1>" 
                "<data2><temp=\"cold\"/></data2></data>"; 
T_XML xml; 
xml = TutXmlCreateStatic(xml_str); 
if (xml == NULL) { 
  /* error */ 
} 
/* xml_str MUST remain valid until TutXmlDestroy is called */ 

TIBCO SmartSockets™ Utilities
Software Release 6.8, July 2006
Copyright © TIBCO Software Inc. All rights reserved
www.tibco.com