Modifier and Type | Field and Description |
---|---|
static short |
UNDEFINED_NODE |
static Collection.Key |
XMLATTRIBUTES |
static Collection.Key |
XMLCDATA |
static Collection.Key |
XMLCHILDREN |
static Collection.Key |
XMLCOMMENT |
static Collection.Key |
XMLNAME |
static Collection.Key |
XMLNODES |
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 and Description |
---|
XMLUtil() |
Modifier and Type | Method and Description |
---|---|
static int |
childNodesLength(Node node,
short type,
boolean caseSensitive,
String filter) |
static XMLReader |
createXMLReader(String oprionalDefaultSaxParser) |
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 |
getProperty(Node node,
Collection.Key k,
boolean caseSensitive,
Object defaultValue)
returns a property from a XMl Node (Expression Less)
|
static Object |
getProperty(Node node,
Collection.Key key,
Object defaultValue) |
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 |
setProperty(Node node,
Collection.Key key,
Object value,
boolean caseSensitive,
Object defaultValue) |
static Object |
setPropertyEL(Node node,
Collection.Key key,
Object value)
sets a node to a node (Expression Less)
|
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,
Charset cs) |
static String |
transform(Document doc,
InputSource xsl)
transform a XML Document to a other format, with help of a XSL Stylesheet
|
static String |
transform(Document doc,
InputSource xsl,
Map parameters)
transform a XML Document 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 |
transform(InputSource xml,
InputSource xsl,
Map parameters)
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) |
public static final short UNDEFINED_NODE
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 XMLNODES
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
public XMLUtil()
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 ObjectSAXException
IOException
ParserConfigurationException
public static Object setPropertyEL(Node node, Collection.Key key, Object value)
node
- key
- value
- public static Object setProperty(Node node, Collection.Key key, Object value, boolean caseSensitive, Object defaultValue)
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 getProperty(Node node, Collection.Key key, Object defaultValue)
public static Object getProperty(Node node, Collection.Key k, boolean caseSensitive, Object defaultValue)
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 frompublic static String transform(InputSource xml, InputSource xsl) throws TransformerException, SAXException, IOException
xml
- xml to convertxsl
- xsl used to convertTransformerException
SAXException
IOException
public static String transform(InputSource xml, InputSource xsl, Map parameters) throws TransformerException, SAXException, IOException
xml
- xml to convertxsl
- xsl used to convertparameters
- parameters used to convertTransformerException
SAXException
IOException
public static String transform(Document doc, InputSource xsl) throws TransformerException
xml
- xml to convertxsl
- xsl used to convertTransformerException
SAXException
IOException
public static String transform(Document doc, InputSource xsl, Map parameters) throws TransformerException
xml
- xml to convertxsl
- xsl used to convertparameters
- parameters used to convertTransformerException
SAXException
IOException
public static String getTypeAsString(Node node, boolean cftype)
node
- cftype
- public static Element getChildWithName(String name, Element el)
public static InputSource toInputSource(Resource res, Charset cs) 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 XMLReader createXMLReader(String oprionalDefaultSaxParser) throws SAXException
SAXException
Copyright © 2015 Lucee