Script functions reference > Script functions in alphabetical order > S > StMsgAttachXMLFile

StMsgAttachXMLFile
Syntax
StMsgAttachXMLFile(strXPath, xml_file, src_XPath);
 
strsXPath
xml_file
src_XPath
Description
StoryTeller tool function.
Appends an XML DOM node – loaded from an XML file – to a Message node.
You can enable declaration of XML namespaces. This is only needed for some XML files or XML streams loaded directly into StoryTeller. It is not needed for normalized data coming from Event tools.
Example of problematic XML:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CRSample</title>
</head>
...
To address the title element, it is not possible to use /html/head/title because it does not select anything. You must instead specify the namespace URI and declare the prefix in StoryTeller in the Processing Properties dialog, in Custom Properties:
xpathns:<prefix>
<URI>
Where <prefix> is the prefix name that will be associated with the specifed <URI>
For the example above it would be:.
xpathns:xhtml
http://www.w3.org/1999/xhtml
With this declaration it is possible to access the title node like this:
/xhtml:html/xhtml:head/xhtml:title
Returns
N/A
Example
StMsgAttachXMLFile("/", "../resources.xml", "/Resources");
OpenText StreamServe 5.6 Updated: 2013-03-01