|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrailo.runtime.text.xml.XMLUtil
public final class XMLUtil
Field Summary | |
---|---|
static Collection.Key |
XMLATTRIBUTES
|
static Collection.Key |
XMLCDATA
|
static Collection.Key |
XMLCHILDREN
|
static Collection.Key |
XMLCOMMENT
|
static Collection.Key |
XMLNAME
|
static Collection.Key |
XMLNSPREFIX
|
static Collection.Key |
XMLNSURI
|
static Collection.Key |
XMLPARENT
|
static Collection.Key |
XMLROOT
|
static Collection.Key |
XMLTEXT
|
static Collection.Key |
XMLTYPE
|
static Collection.Key |
XMLVALUE
|
Constructor Summary | |
---|---|
XMLUtil()
|
Method Summary | |
---|---|
static int |
childNodesLength(Node node,
short type,
boolean caseSensitive,
String filter)
|
static String |
escapeXMLString(String xmlStr)
|
static Element[] |
getChildElementsAsArray(Node node)
return all Element Children of a node |
static Node |
getChildNode(Node node,
short type,
boolean caseSensitive,
String filter,
int index)
|
static ArrayNodeList |
getChildNodes(Node node,
short type)
return all Children of a node by a defined type as Node List |
static ArrayNodeList |
getChildNodes(Node node,
short type,
boolean caseSensitive,
String filter)
|
static Node[] |
getChildNodesAsArray(Node node,
short type)
return all Children of a node by a defined type as Node Array |
static Node[] |
getChildNodesAsArray(Node node,
short type,
boolean caseSensitive,
String filter)
|
static List<Node> |
getChildNodesAsList(Node node,
short type,
boolean caseSensitive,
String filter)
|
static Element |
getChildWithName(String name,
Element el)
|
static Document |
getDocument(Node node)
return the Owner Document of a Node |
static Document |
getDocument(NodeList nodeList)
return the Owner Document of a Node List |
static Node |
getParentNode(Node node,
boolean caseSensitive)
|
static Object |
getProperty(Node node,
Collection.Key key)
|
static Object |
getProperty(Node node,
Collection.Key k,
boolean caseSensitive)
returns a property from a XMl Node |
static Object |
getPropertyEL(Node node,
Collection.Key key)
|
static Object |
getPropertyEL(Node node,
Collection.Key k,
boolean caseSensitive)
returns a property from a XMl Node (Expression Less) |
static Element |
getRootElement(Node node,
boolean caseSensitive)
return the root Element from a node |
static TransformerFactory |
getTransformerFactory()
|
static String |
getTypeAsString(Node node,
boolean cftype)
returns the Node Type As String |
static boolean |
isCaseSensitve(Node node)
|
static boolean |
nameEqual(Node node,
String name,
boolean caseSensitive)
check if given name is equal to name of the element (with and without namespace) |
static Document |
newDocument()
returns a new Empty XMl Document |
static Document |
parse(InputSource xml,
InputSource validator,
boolean isHtml)
parse XML/HTML String to a XML DOM representation |
static void |
prependChild(Element parent,
Element child)
adds a child at the first place |
static Object |
removeProperty(Node node,
Collection.Key k,
boolean caseSensitive)
removes child from a node |
static void |
replaceChild(Node newChild,
Node oldChild)
|
static void |
setFirst(Node parent,
Node node)
|
static Object |
setProperty(Node node,
Collection.Key k,
Object value)
sets a node to a node |
static Object |
setProperty(Node node,
Collection.Key k,
Object value,
boolean caseSensitive)
|
static Object |
setPropertyEL(Node node,
Collection.Key key,
Object value)
sets a node to a node (Expression Less) |
static Object |
setPropertyEL(Node node,
Collection.Key key,
Object value,
boolean caseSensitive)
|
static InputSource |
toInputSource(PageContext pc,
Object value)
|
static InputSource |
toInputSource(PageContext pc,
String xml)
|
static InputSource |
toInputSource(PageContext pc,
String xml,
boolean canBePath)
|
static InputSource |
toInputSource(Resource res)
|
static String |
transform(Document doc,
InputSource xsl)
transform a XML Object to a other format, with help of a XSL Stylesheet |
static String |
transform(InputSource xml,
InputSource xsl)
transform a XML Object to a other format, with help of a XSL Stylesheet |
static String |
unescapeXMLString(String str)
|
static String |
unescapeXMLString2(String str)
|
static Struct |
validate(InputSource xml,
InputSource schema,
String strSchema)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Collection.Key XMLCOMMENT
public static final Collection.Key XMLTEXT
public static final Collection.Key XMLCDATA
public static final Collection.Key XMLCHILDREN
public static final Collection.Key XMLNSURI
public static final Collection.Key XMLNSPREFIX
public static final Collection.Key XMLROOT
public static final Collection.Key XMLPARENT
public static final Collection.Key XMLNAME
public static final Collection.Key XMLTYPE
public static final Collection.Key XMLVALUE
public static final Collection.Key XMLATTRIBUTES
Constructor Detail |
---|
public XMLUtil()
Method Detail |
---|
public static String unescapeXMLString(String str)
public static String unescapeXMLString2(String str)
public static String escapeXMLString(String xmlStr)
public static TransformerFactory getTransformerFactory()
public static final Document parse(InputSource xml, InputSource validator, boolean isHtml) throws SAXException, IOException
xml
- XML InputSourceisHtml
- is a HTML or XML Object
SAXException
IOException
ParserConfigurationException
public static Object setPropertyEL(Node node, Collection.Key key, Object value)
node
- key
- value
-
public static Object setPropertyEL(Node node, Collection.Key key, Object value, boolean caseSensitive)
public static Object setProperty(Node node, Collection.Key k, Object value) throws PageException
node
- key
- value
-
PageException
public static Object setProperty(Node node, Collection.Key k, Object value, boolean caseSensitive) throws PageException
PageException
public static void replaceChild(Node newChild, Node oldChild)
public static Object getPropertyEL(Node node, Collection.Key key)
public static Object getPropertyEL(Node node, Collection.Key k, boolean caseSensitive)
node
- key
- caseSensitive
-
public static Object getProperty(Node node, Collection.Key key) throws SAXException
SAXException
public static Object getProperty(Node node, Collection.Key k, boolean caseSensitive) throws SAXException
node
- key
- caseSensitive
-
SAXException
public static boolean nameEqual(Node node, String name, boolean caseSensitive)
node
- k
- caseSensitive
-
public static boolean isCaseSensitve(Node node)
public static Object removeProperty(Node node, Collection.Key k, boolean caseSensitive)
node
- key
- caseSensitive
-
public static Element getRootElement(Node node, boolean caseSensitive)
node
- node to get root element fromcaseSensitive
-
public static Node getParentNode(Node node, boolean caseSensitive)
public static Document newDocument() throws ParserConfigurationException, FactoryConfigurationError
ParserConfigurationException
FactoryConfigurationError
public static Document getDocument(NodeList nodeList) throws XMLException
nodeList
-
XMLException
public static Document getDocument(Node node)
node
-
public static ArrayNodeList getChildNodes(Node node, short type)
node
- node to get children fromtype
- type of returned nodefilter
- caseSensitive
-
public static int childNodesLength(Node node, short type, boolean caseSensitive, String filter)
public static ArrayNodeList getChildNodes(Node node, short type, boolean caseSensitive, String filter)
public static List<Node> getChildNodesAsList(Node node, short type, boolean caseSensitive, String filter)
public static Node getChildNode(Node node, short type, boolean caseSensitive, String filter, int index)
public static Node[] getChildNodesAsArray(Node node, short type)
node
- node to get children fromtype
- type of returned nodefilter
- caseSensitive
-
public static Node[] getChildNodesAsArray(Node node, short type, boolean caseSensitive, String filter)
public static Element[] getChildElementsAsArray(Node node)
node
- node to get children from
public static String transform(InputSource xml, InputSource xsl) throws TransformerException, SAXException, IOException
strXML
- XML StringstrXSL
- XSL String
TransformerException
IOException
SAXException
public static String transform(Document doc, InputSource xsl) throws TransformerException
doc
- XML Document ObjectstrXSL
- XSL String
TransformerException
public static String getTypeAsString(Node node, boolean cftype)
node
- cftype
-
public static Element getChildWithName(String name, Element el)
public static InputSource toInputSource(Resource res) throws IOException
IOException
public static InputSource toInputSource(PageContext pc, Object value) throws IOException, ExpressionException
IOException
ExpressionException
public static InputSource toInputSource(PageContext pc, String xml) throws IOException, ExpressionException
IOException
ExpressionException
public static InputSource toInputSource(PageContext pc, String xml, boolean canBePath) throws IOException, ExpressionException
IOException
ExpressionException
public static Struct validate(InputSource xml, InputSource schema, String strSchema) throws XMLException
XMLException
public static void prependChild(Element parent, Element child)
parent
- child
- public static void setFirst(Node parent, Node node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |