org.teiid.query.function.source
Class XMLSystemFunctions
java.lang.Object
org.teiid.query.function.source.XMLSystemFunctions
public class XMLSystemFunctions
- extends Object
This class contains scalar system functions supporting for XML manipulation.
- Since:
- 4.2
Method Summary |
static net.sf.saxon.value.AtomicValue |
convertToAtomicValue(Object value)
|
static Source |
convertToSource(Object value)
|
static String |
escapeName(String name,
boolean fully)
|
static XMLOutputFactory |
getOutputFactory()
|
static SQLXML |
jsonToXml(CommandContext context,
String rootName,
Blob json)
|
static SQLXML |
jsonToXml(CommandContext context,
String rootName,
Clob json)
|
static SQLXMLImpl |
saveToBufferManager(BufferManager bufferMgr,
XMLTranslator translator)
This method saves the given XML object to the buffer manager's disk process
Documents less than the maxMemorySize will be held directly in memory |
static void |
validateXpath(String xpath)
Validate whether the XPath is a valid XPath. |
static XMLType |
xmlComment(String comment)
|
static XMLType |
xmlConcat(CommandContext context,
XMLType xml,
Object... other)
|
static XMLType |
xmlElement(CommandContext context,
String name,
Evaluator.NameValuePair<String>[] namespaces,
Evaluator.NameValuePair<?>[] attributes,
List<?> contents)
Basic support for xmlelement. |
static XMLType |
xmlForest(CommandContext context,
Evaluator.NameValuePair[] namespaces,
Evaluator.NameValuePair[] values)
|
static XMLType |
xmlPi(String name)
|
static XMLType |
xmlPi(String name,
String content)
|
static String |
xpathValue(Object doc,
String xpath)
|
static ClobType |
xslTransform(CommandContext context,
Object xml,
Object styleSheet)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLSystemFunctions
public XMLSystemFunctions()
getOutputFactory
public static XMLOutputFactory getOutputFactory()
throws FactoryConfigurationError
- Throws:
FactoryConfigurationError
xslTransform
public static ClobType xslTransform(CommandContext context,
Object xml,
Object styleSheet)
throws Exception
- Throws:
Exception
xmlForest
public static XMLType xmlForest(CommandContext context,
Evaluator.NameValuePair[] namespaces,
Evaluator.NameValuePair[] values)
throws TeiidComponentException,
TeiidProcessingException
- Throws:
TeiidComponentException
TeiidProcessingException
xmlElement
public static XMLType xmlElement(CommandContext context,
String name,
Evaluator.NameValuePair<String>[] namespaces,
Evaluator.NameValuePair<?>[] attributes,
List<?> contents)
throws TeiidComponentException,
TeiidProcessingException
- Basic support for xmlelement. namespaces are not yet supported.
- Parameters:
context
- name
- contents
-
- Returns:
-
- Throws:
TeiidComponentException
TeiidProcessingException
xmlConcat
public static XMLType xmlConcat(CommandContext context,
XMLType xml,
Object... other)
throws TeiidProcessingException
- Throws:
TeiidProcessingException
xmlPi
public static XMLType xmlPi(String name)
xmlPi
public static XMLType xmlPi(String name,
String content)
convertToAtomicValue
public static net.sf.saxon.value.AtomicValue convertToAtomicValue(Object value)
throws TransformerException
- Throws:
TransformerException
xmlComment
public static XMLType xmlComment(String comment)
convertToSource
public static Source convertToSource(Object value)
throws TeiidProcessingException
- Throws:
TeiidProcessingException
xpathValue
public static String xpathValue(Object doc,
String xpath)
throws net.sf.saxon.trans.XPathException,
TeiidProcessingException
- Throws:
net.sf.saxon.trans.XPathException
TeiidProcessingException
validateXpath
public static void validateXpath(String xpath)
throws net.sf.saxon.trans.XPathException
- Validate whether the XPath is a valid XPath. If not valid, an XPathExpressionException will be thrown.
- Parameters:
xpath
- An xpath expression, for example: a/b/c/getText()
- Throws:
XPathExpressionException
net.sf.saxon.trans.XPathException
escapeName
public static String escapeName(String name,
boolean fully)
jsonToXml
public static SQLXML jsonToXml(CommandContext context,
String rootName,
Blob json)
throws TeiidComponentException,
TeiidProcessingException,
SQLException,
IOException
- Throws:
TeiidComponentException
TeiidProcessingException
SQLException
IOException
jsonToXml
public static SQLXML jsonToXml(CommandContext context,
String rootName,
Clob json)
throws TeiidComponentException,
TeiidProcessingException,
SQLException
- Throws:
TeiidComponentException
TeiidProcessingException
SQLException
saveToBufferManager
public static SQLXMLImpl saveToBufferManager(BufferManager bufferMgr,
XMLTranslator translator)
throws TeiidComponentException,
TeiidProcessingException
- This method saves the given XML object to the buffer manager's disk process
Documents less than the maxMemorySize will be held directly in memory
- Throws:
TeiidComponentException
TeiidProcessingException
Copyright © 2012. All Rights Reserved.