|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.ide.xml.XMLUtil
Utility methods for quickly inspecting the contents of an XML file.
Method Summary | |
static java.lang.String |
getElementValue(java.io.File file,
java.lang.String element)
Returns the value associated with the first occurrence of the specified element tag contained in the xml file pointed to by
the file . |
static java.lang.String |
getElementValue(java.net.URL url,
java.lang.String element)
Returns the value associated with the first occurrence of the specified element tag contained in the xml file pointed to by
the url . |
static StartElementPacket |
getXMLRootElement(java.io.InputStream in)
|
static StartElementPacket |
getXMLRootElement(java.io.Reader reader)
|
static StartElementPacket |
getXMLRootElement(java.net.URL url)
This method assumes that the content pointed to by the given URL is for an XML file. |
static oracle.xml.parser.v2.XSLStylesheet |
loadXSLT(java.net.URL xslt)
This method loads an XSLT file into memory, setting the "encoding" attribute on the xsl:output element to match the default IANA encoding of the current platform. |
static java.lang.String |
toNamespaceURI(java.lang.String documentID)
Returns a full XML Namespace URI that uses the current base namespace URI and appends the specified "document ID". |
static java.lang.String |
toString(oracle.xml.parser.v2.XMLDocument xmlDocument)
Returns the specified XMLDocument as a single String representing the contents of the document as if they
were emitted to a file. |
static void |
transformXML(java.net.URL xml,
java.net.URL xslt)
Transforms an XML document according to an XSLT file. |
static void |
writeXML(oracle.xml.parser.v2.XMLDocument xmlDocument,
java.io.OutputStream out)
Writes the specified XMLDocument to the output stream
specified. |
static void |
writeXML(oracle.xml.parser.v2.XMLDocument xmlDocument,
java.io.PrintWriter printWriter)
|
static void |
writeXML(oracle.xml.parser.v2.XMLDocument xmlDocument,
java.io.PrintWriter printWriter,
int indentIncr)
|
static void |
writeXML(oracle.xml.parser.v2.XMLDocument xmlDocument,
java.net.URL url)
Writes the specified XMLDocument to the file
located at the specified URL . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static StartElementPacket getXMLRootElement(java.net.URL url) throws java.io.FileNotFoundException
URL
is for an XML file. The method then reads the
XML content and returns the root element name when it is found.
If the XML file could not be parsed for some reason (e.g. there
was an XML parsing error), then null
is returned.
java.io.FileNotFoundException
public static StartElementPacket getXMLRootElement(java.io.InputStream in)
public static StartElementPacket getXMLRootElement(java.io.Reader reader)
public static oracle.xml.parser.v2.XSLStylesheet loadXSLT(java.net.URL xslt) throws java.io.IOException, org.xml.sax.SAXException, oracle.xml.parser.v2.XSLException
java.io.IOException
org.xml.sax.SAXException
oracle.xml.parser.v2.XSLException
public static void transformXML(java.net.URL xml, java.net.URL xslt) throws java.io.IOException, org.xml.sax.SAXException, oracle.xml.parser.v2.XSLException
java.io.IOException
org.xml.sax.SAXException
oracle.xml.parser.v2.XSLException
public static void writeXML(oracle.xml.parser.v2.XMLDocument xmlDocument, java.net.URL url) throws java.io.IOException
XMLDocument
to the file
located at the specified URL
.
java.io.IOException
- if an I/O error occurs when writing the
XML file.public static void writeXML(oracle.xml.parser.v2.XMLDocument xmlDocument, java.io.OutputStream out) throws java.io.IOException
XMLDocument
to the output stream
specified. Upon completion, the output stream will be closed.
java.io.IOException
- if an I/O error occurs when writing the
XML file.public static void writeXML(oracle.xml.parser.v2.XMLDocument xmlDocument, java.io.PrintWriter printWriter) throws java.io.IOException
java.io.IOException
public static void writeXML(oracle.xml.parser.v2.XMLDocument xmlDocument, java.io.PrintWriter printWriter, int indentIncr) throws java.io.IOException
java.io.IOException
public static java.lang.String toNamespaceURI(java.lang.String documentID)
For example, passing in "jproject" would return something like:
Passing in "j2ee/ejb-jar" would return something like:http://xmlns.oracle.com/jdeveloper/902rc/jproject
http://xmlns.oracle.com/jdeveloper/902rc/j2ee/ejb-jar
public static java.lang.String toString(oracle.xml.parser.v2.XMLDocument xmlDocument)
XMLDocument
as a single String
representing the contents of the document as if they
were emitted to a file. If an IOException
occurs during
processing, the empty string is returned.
public static java.lang.String getElementValue(java.net.URL url, java.lang.String element)
element
tag contained in the xml file pointed to by
the url
. Returns null
if the tag is not found,
or does to have a text value associated with it.
public static java.lang.String getElementValue(java.io.File file, java.lang.String element)
element
tag contained in the xml file pointed to by
the file
. Returns null
if the tag is not found,
or does to have a text value associated with it.
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.