About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Last updated: Feb 11, 2025
The XML content model provides access to XML-based content.
The XML content model supports the ability to access components based on XPath expressions. XPath expressions are strings that define which elements or attributes are required by the caller. The XML content model hides the details of constructing various objects and compiling expressions that are typically required by XPath support. It is simpler to call from Python scripting.
The XML content model includes a function that returns the XML document as a string, so Python script users can use their preferred Python library to parse the XML.
Method | Return types | Description |
---|---|---|
|
|
Returns the XML as a string. |
|
|
Returns the result of evaluating the path with return type of numeric (for example, count the number of elements that match the path expression). |
|
|
Returns the boolean result of evaluating the specified path expression. |
|
|
Returns either the attribute value or XML node value that matches the specified path. |
|
|
Returns a list of all attribute values or XML node values that match the specified path. |
|
|
Returns a list of all attribute values that match the specified path along with the XML node value if required. |
|
|
Returns a hash table that uses either the key attribute or XML node value as key, and the list of specified attribute values as table values. |
|
|
Returns whether the XML parsers should be aware of namespaces. Default is
. |
|
|
Sets whether the XML parsers should be aware of namespaces. This also calls
to ensure changes are picked up by subsequent calls. |
|
|
Flushes any internal storage associated with this content model (for example, a cached DOM object). |
Nodes and outputs
This table lists nodes that build outputs that include this type of content model.
Node name | Output name | Container ID |
---|---|---|
|
|
|
|
|
|
Example script
The Python scripting code to access the content might look like this:
results = [] modelbuilder.run(results) modeloutput = results[0] cm = modeloutput.getContentModel("PMML") dataFieldNames = cm.getStringValues("/PMML/DataDictionary/DataField", "name") predictedNames = cm.getStringValues("//MiningSchema/MiningField[@usageType='predicted']", "name")
Was the topic helpful?
0/1000