|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mondrian.tui.XmlUtil
public class XmlUtil
Some XML parsing, validation and transform utility methods used to valiate XMLA responses.
Nested Class Summary | |
---|---|
static class |
XmlUtil.Resolver
This can be extened to have a map from publicId/systemId to InputSource. |
static class |
XmlUtil.SAXErrorHandler
Error handler plus helper methods. |
Field Summary | |
---|---|
static String |
DEFER_NODE_EXPANSION
|
static String |
FULL_SCHEMA_VALIDATION_FEATURE_ID
|
static String |
LINE_SEP
|
static String |
NAMESPACES_FEATURE_ID
|
static String |
SCHEMA_LOCATION
|
static String |
SCHEMA_VALIDATION_FEATURE_ID
|
static String |
SOAP_PREFIX
|
static String |
VALIDATION_FEATURE_ID
|
static String |
XMLNS
|
static String |
XSD_PREFIX
|
Method Summary | |
---|---|
static Node[] |
convertToNodes(org.w3c.dom.xpath.XPathResult xpathResult)
Convert an XPathResult to an array of Nodes. |
static String |
convertToString(org.w3c.dom.xpath.XPathResult xpathResult,
boolean prettyPrint)
Convert an XPathResult object to String. |
static Document |
createContextDocument(String[][] nsArray)
Create a context document for use in performing XPath operations. |
static String |
getNamespaceAttributeValue(Document doc)
This is used to get a Document's namespace attribute value. |
static org.apache.xerces.parsers.DOMParser |
getParser(String schemaLocationPropertyValue,
EntityResolver entityResolver,
boolean validate)
Get your non-cached DOM parser which can be configured to do schema based validation of the instance Document. |
static String |
getSoapXmlaXds2xd(String xmlaPrefix)
This is the xslt that can extract the "data" part of a SOAP XMLA response. |
static String |
getSoapXmlaXds2xs(String xmlaPrefix)
This is the xslt that can extract the "schema" part of a SOAP XMLA response. |
static TransformerFactory |
getTransformerFactory()
|
static String |
getXercesVersion()
Get the Xerces version being used. |
static int[] |
getXercesVersionNumbers()
Gets the Xerces version numbers as a three part array of ints where the first element is the major release number, the second is the minor release number, and the third is the patch number. |
static String |
getXercesVersionNumberString()
Get the number part of the Xerces Version string. |
static String |
getXmlaXds2xd(String ns)
This is the xslt that can extract the "data" part of a XMLA response. |
static String |
getXmlaXds2xs(String ns)
This is the xslt that can extract the "schema" part of a XMLA response. |
static String |
makeRootPathInSoapBody()
|
static String |
makeRootPathInSoapBody(String xmlaPrefix,
String xsdPrefix)
|
static String |
makeSoapPath()
|
static String |
makeSoapPath(String prefix)
|
static Document |
newDocument(Node firstElement,
boolean deepcopy)
|
static Document |
parse(byte[] bytes)
Parse a byte array into a Document (no validation). |
static Document |
parse(File file)
|
static Document |
parse(InputStream in)
Parse a stream into a Document (no validation). |
static Document |
parseString(String s)
Parse a String into a Document (no validation). |
static org.w3c.dom.xpath.XPathResult |
select(Node contextNode,
String xpath,
Node namespaceNode)
|
static Node[] |
selectAsNodes(Node node,
String xpath)
|
static Node[] |
selectAsNodes(Node node,
String xpath,
Node namespaceNode)
|
static String |
selectAsString(Node node,
String xpath)
|
static String |
selectAsString(Node node,
String xpath,
Node namespaceNode)
|
static boolean |
supportsValidation()
Returns whether the XML parser supports validation. |
static String |
toString(Node node,
boolean prettyPrint)
Convert a Node to a String. |
static Node |
transform(Document inDoc,
Reader xslReader)
|
static Node |
transform(Document inDoc,
Reader xslReader,
String[][] namevalueParameters)
Transform a Document and return the transformed Node. |
static Node |
transform(Document inDoc,
String xslFileName)
|
static Node |
transform(Document inDoc,
String xslFileName,
String[][] namevalueParameters)
Transform a Document and return the transformed Node. |
static void |
validate(Document doc,
String schemaLocationPropertyValue,
EntityResolver resolver)
|
static void |
validate(String docStr,
String schemaLocationPropertyValue,
EntityResolver resolver)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String LINE_SEP
public static final String SOAP_PREFIX
public static final String XSD_PREFIX
public static final String XMLNS
public static final String NAMESPACES_FEATURE_ID
public static final String VALIDATION_FEATURE_ID
public static final String SCHEMA_VALIDATION_FEATURE_ID
public static final String FULL_SCHEMA_VALIDATION_FEATURE_ID
public static final String DEFER_NODE_EXPANSION
public static final String SCHEMA_LOCATION
Method Detail |
---|
public static final String getSoapXmlaXds2xd(String xmlaPrefix)
public static final String getSoapXmlaXds2xs(String xmlaPrefix)
public static final String getXmlaXds2xd(String ns)
public static final String getXmlaXds2xs(String ns)
public static Document newDocument(Node firstElement, boolean deepcopy)
public static org.apache.xerces.parsers.DOMParser getParser(String schemaLocationPropertyValue, EntityResolver entityResolver, boolean validate) throws SAXNotRecognizedException, SAXNotSupportedException
SAXNotRecognizedException
SAXNotSupportedException
public static Document parseString(String s) throws SAXException, IOException
SAXException
IOException
public static Document parse(byte[] bytes) throws SAXException, IOException
SAXException
IOException
public static Document parse(File file) throws SAXException, IOException
SAXException
IOException
public static Document parse(InputStream in) throws SAXException, IOException
SAXException
IOException
public static Document createContextDocument(String[][] nsArray) throws SAXException, IOException
SAXException
IOException
public static String makeSoapPath()
public static String makeSoapPath(String prefix)
public static String makeRootPathInSoapBody()
public static String makeRootPathInSoapBody(String xmlaPrefix, String xsdPrefix)
public static String selectAsString(Node node, String xpath) throws org.w3c.dom.xpath.XPathException
org.w3c.dom.xpath.XPathException
public static String selectAsString(Node node, String xpath, Node namespaceNode) throws org.w3c.dom.xpath.XPathException
org.w3c.dom.xpath.XPathException
public static Node[] selectAsNodes(Node node, String xpath) throws org.w3c.dom.xpath.XPathException
org.w3c.dom.xpath.XPathException
public static Node[] selectAsNodes(Node node, String xpath, Node namespaceNode) throws org.w3c.dom.xpath.XPathException
org.w3c.dom.xpath.XPathException
public static org.w3c.dom.xpath.XPathResult select(Node contextNode, String xpath, Node namespaceNode) throws org.w3c.dom.xpath.XPathException
org.w3c.dom.xpath.XPathException
public static String convertToString(org.w3c.dom.xpath.XPathResult xpathResult, boolean prettyPrint)
public static Node[] convertToNodes(org.w3c.dom.xpath.XPathResult xpathResult)
public static String toString(Node node, boolean prettyPrint)
public static String getXercesVersion()
public static String getXercesVersionNumberString()
public static int[] getXercesVersionNumbers()
public static boolean supportsValidation()
I could not get validation to work with Xerces 2.2 so I put in this check. If you want to test on an earlier version of Xerces simply define the above property: "mondrian.xml.always.attempt.validation", to true.
public static void validate(Document doc, String schemaLocationPropertyValue, EntityResolver resolver) throws IOException, SAXException
IOException
SAXException
public static void validate(String docStr, String schemaLocationPropertyValue, EntityResolver resolver) throws IOException, SAXException
IOException
SAXException
public static String getNamespaceAttributeValue(Document doc)
public static TransformerFactory getTransformerFactory() throws TransformerFactoryConfigurationError
TransformerFactoryConfigurationError
public static Node transform(Document inDoc, String xslFileName, String[][] namevalueParameters) throws ParserConfigurationException, SAXException, IOException, TransformerConfigurationException, TransformerException
ParserConfigurationException
SAXException
IOException
TransformerConfigurationException
TransformerException
public static Node transform(Document inDoc, String xslFileName) throws ParserConfigurationException, SAXException, IOException, TransformerConfigurationException, TransformerException
ParserConfigurationException
SAXException
IOException
TransformerConfigurationException
TransformerException
public static Node transform(Document inDoc, Reader xslReader, String[][] namevalueParameters) throws ParserConfigurationException, SAXException, IOException, TransformerConfigurationException, TransformerException
ParserConfigurationException
SAXException
IOException
TransformerConfigurationException
TransformerException
public static Node transform(Document inDoc, Reader xslReader) throws ParserConfigurationException, SAXException, IOException, TransformerConfigurationException, TransformerException
ParserConfigurationException
SAXException
IOException
TransformerConfigurationException
TransformerException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |