public interface XMLService extends SCIFIOService
| Modifier and Type | Method and Description |
|---|---|
String |
avoidUndeclaredNamespaces(String xml)
Replaces NS:tag with NS_tag for undeclared namespaces
|
String |
escapeXML(String s)
Escape special characters.
|
Templates |
getStylesheet(String resourcePath,
Class<?> sourceClass)
Gets an XSLT template from the given resource location.
|
String |
getXML(Document doc)
Converts the given DOM back to a string.
|
String |
indentXML(String xml)
Indents XML to be more readable.
|
String |
indentXML(String xml,
boolean preserveCData)
Indents XML to be more readable, avoiding any whitespace injection into
CDATA if the preserveCData flag is set.
|
String |
indentXML(String xml,
int spacing)
Indents XML by the given spacing to be more readable.
|
String |
indentXML(String xml,
int spacing,
boolean preserveCData)
Indents XML by the given spacing to be more readable, avoiding any
whitespace injection into CDATA if the preserveCData flag is set.
|
Document |
parseDOM(File file)
Parses a DOM from the given XML file on disk.
|
Document |
parseDOM(InputStream is)
Parses a DOM from the given XML input stream.
|
Document |
parseDOM(String xml)
Parses a DOM from the given XML string.
|
void |
parseXML(byte[] xml,
DefaultHandler handler)
Parses the XML contained in the given byte array into using the specified
XML handler.
|
void |
parseXML(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> handle,
DefaultHandler handler)
Parses the XML contained in the given data handle into using the specified
XML handler.
|
void |
parseXML(InputStream xml,
DefaultHandler handler)
Parses the XML contained in the given InputStream using the specified XML
handler.
|
Map<String,String> |
parseXML(String xml)
Parses the given XML string into a list of key/value pairs.
|
void |
parseXML(String xml,
DefaultHandler handler)
Parses the given XML string using the specified XML handler.
|
String |
sanitizeXML(String s)
Remove invalid characters from an XML string.
|
String |
transformXML(Source xmlSource,
Templates xslt)
Transforms the given XML data using the specified XSLT stylesheet.
|
String |
transformXML(String xml,
Templates xslt)
Transforms the given XML string using the specified XSLT stylesheet.
|
boolean |
validateXML(String xml)
Attempts to validate the given XML string using Java's XML validation
facility.
|
boolean |
validateXML(String xml,
String label)
Attempts to validate the given XML string using Java's XML validation
facility.
|
initialize, registerEventHandlersgetIdentifier, logcontext, getContext, setContextcompareTo, getPriority, setPrioritygetInfo, setInfogetLocationgetVersiondisposeDocument parseDOM(File file) throws ParserConfigurationException, SAXException, IOException
Document parseDOM(String xml) throws ParserConfigurationException, SAXException, IOException
Document parseDOM(InputStream is) throws ParserConfigurationException, SAXException, IOException
String getXML(Document doc) throws TransformerConfigurationException, TransformerException
String indentXML(String xml, int spacing)
String indentXML(String xml, boolean preserveCData)
String indentXML(String xml, int spacing, boolean preserveCData)
Map<String,String> parseXML(String xml) throws IOException
IOExceptionvoid parseXML(String xml, DefaultHandler handler) throws IOException
IOExceptionvoid parseXML(org.scijava.io.handle.DataHandle<org.scijava.io.location.Location> handle, DefaultHandler handler) throws IOException
IOExceptionvoid parseXML(byte[] xml,
DefaultHandler handler)
throws IOException
IOExceptionvoid parseXML(InputStream xml, DefaultHandler handler) throws IOException
IOExceptionTemplates getStylesheet(String resourcePath, Class<?> sourceClass)
String avoidUndeclaredNamespaces(String xml)
String transformXML(String xml, Templates xslt) throws IOException
IOExceptionString transformXML(Source xmlSource, Templates xslt) throws IOException
IOExceptionboolean validateXML(String xml)
xml - The XML string to validate.boolean validateXML(String xml, String label)
xml - The XML string to validate.label - String describing the type of XML being validated.Copyright © 2011–2026 SCIFIO. All rights reserved.