| java.lang.Object org.apache.cocoon.xml.XMLUtils
Method Summary | |
public static void | createElement(ContentHandler contentHandler, String localName) | public static void | createElement(ContentHandler contentHandler, String localName, String stringValue) | public static void | createElement(ContentHandler contentHandler, String localName, Attributes atts) Create a start and endElement with a empty Namespace
Parameters: localName - The local name (without prefix) Parameters: atts - The attributes attached to the element. | public static void | createElement(ContentHandler contentHandler, String localName, Attributes atts, String stringValue) Create a start and endElement with a empty Namespace
The content of the Element is set to the stringValue parameter
Parameters: localName - The local name (without prefix) Parameters: atts - The attributes attached to the element. | public static void | createElementNS(ContentHandler contentHandler, String namespaceURI, String localName) | public static void | createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, String stringValue) | public static void | createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts) Create a start and endElement
Parameters: localName - The local name (without prefix) Parameters: atts - The attributes attached to the element. | public static void | createElementNS(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts, String stringValue) Create a start and endElement with a empty Namespace
The content of the Element is set to the stringValue parameter
Parameters: localName - The local name (without prefix) Parameters: atts - The attributes attached to the element. | public static Properties | createPropertiesForXML(boolean omitXMLDeclaration) Create a new properties set for serializing xml. | public static void | data(ContentHandler contentHandler, String data) | public static Properties | defaultSerializeToXMLFormat() This is the default properties set used to serialize xml. | public static Properties | defaultSerializeToXMLFormat(boolean omitXMLDeclaration) This is the default properties set used to serialize xml. | public static void | endElement(ContentHandler contentHandler, String localName) | public static void | endElement(ContentHandler contentHandler, String namespaceURI, String localName) | public static XMLConsumer | getConsumer(ContentHandler ch, LexicalHandler lh) Get an XMLConsumer from a ContentHandler and
a LexicalHandler . | public static XMLConsumer | getConsumer(ContentHandler ch) Get an XMLConsumer from ContentHandler . | public static String | serialize(org.apache.excalibur.xml.sax.XMLizable xml, Properties format) Serialize a XMLizable into a string. | public static String | serializeNode(Node node) Serialize a DOM node into a string using format created by
createPropertiesForXML(false) . | public static String | serializeNode(Node node, Properties format) Serialize a DOM node into a string. | public static String | serializeNodeToXML(Node node) Serialize a DOM node to a String. | public static void | startElement(ContentHandler contentHandler, String localName) | public static void | startElement(ContentHandler contentHandler, String namespaceURI, String localName) | public static void | startElement(ContentHandler contentHandler, String localName, Attributes atts) Create a startElement with a empty Namespace
Parameters: localName - The local name (without prefix) Parameters: atts - The attributes attached to the element. | public static void | startElement(ContentHandler contentHandler, String namespaceURI, String localName, Attributes atts) Create a startElement with a empty Namespace
Prefix must be mapped to empty String
Parameters: namespaceURI - The Namespace URI Parameters: localName - The local name (without prefix) Parameters: atts - The attributes attached to the element. | public static void | stripDuplicateAttributes(Node node, Node parent) | public static void | valueOf(ContentHandler contentHandler, String text) Implementation of <xsp:expr> for String :
outputs characters representing the value. | public static void | valueOf(ContentHandler contentHandler, org.apache.excalibur.xml.sax.XMLizable v) Implementation of <xsp:expr> for XMLizable :
outputs the value by calling v.toSax(contentHandler) . | public static void | valueOf(ContentHandler contentHandler, Node v) Implementation of <xsp:expr> for org.w3c.dom.Node :
converts the Node to a SAX event stream. | public static void | valueOf(ContentHandler contentHandler, Collection v) Implementation of <xsp:expr> for java.util.Collection :
outputs the value by calling xspExpr() on each element of the
collection. | public static void | valueOf(ContentHandler contentHandler, Object v) |
EMPTY_ATTRIBUTES | final public static Attributes EMPTY_ATTRIBUTES(Code) | | Empty attributes immutable object.
|
createPropertiesForXML | public static Properties createPropertiesForXML(boolean omitXMLDeclaration)(Code) | | Create a new properties set for serializing xml.
The omit xml declaration property can be controlled by the flag.
- Method: xml
- Omit xml declaration: according to the flag
- Indent: yes
|
data | public static void data(ContentHandler contentHandler, String data) throws SAXException(Code) | | Add string data
Parameters: contentHandler - The SAX content handler Parameters: data - The string data |
defaultSerializeToXMLFormat | public static Properties defaultSerializeToXMLFormat()(Code) | | This is the default properties set used to serialize xml.
It is used by the serializeNodeToXML() method.
The format is as follows:
Method: xml
Encoding: ISO-8859-1
Omit xml declaration: no
Indent: yes
|
defaultSerializeToXMLFormat | public static Properties defaultSerializeToXMLFormat(boolean omitXMLDeclaration)(Code) | | This is the default properties set used to serialize xml.
It is used by the serializeNodeToXML() method.
The omit xml declaration property can be controlled by the flag.
Method: xml
Encoding: ISO-8859-1
Omit xml declaration: according to the flag
Indent: yes
|
endElement | public static void endElement(ContentHandler contentHandler, String localName) throws SAXException(Code) | | Create endElement with empty Namespace
For information on the names, see startElement.
Parameters: localName - The local name (without prefix) exception: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. |
endElement | public static void endElement(ContentHandler contentHandler, String namespaceURI, String localName) throws SAXException(Code) | | Create endElement
Prefix must be mapped to empty String
For information on the names, see startElement.
Parameters: localName - The local name (without prefix) exception: org.xml.sax.SAXException - Any SAX exception, possiblywrapping another exception. |
getConsumer | public static XMLConsumer getConsumer(ContentHandler ch, LexicalHandler lh)(Code) | | Get an XMLConsumer from a ContentHandler and
a LexicalHandler . If the content handler is already an
XMLConsumer , it is returned as is, otherwise it is wrapped
in an XMLConsumer with the lexical handler.
Parameters: ch - the content handler, which should not be null Parameters: lh - the lexical handler, which can be null an XMLConsumer for ch an lh |
getConsumer | public static XMLConsumer getConsumer(ContentHandler ch)(Code) | | Get an XMLConsumer from ContentHandler . If the
content handler is already an XMLConsumer , it is returned as
is, otherwise it is wrapped in an XMLConsumer .
Parameters: ch - the content handler, which should not be null an XMLConsumer for ch |
serialize | public static String serialize(org.apache.excalibur.xml.sax.XMLizable xml, Properties format) throws ProcessingException(Code) | | Serialize a XMLizable into a string.
If the object is null the empty string is returned.
Parameters: format - The format of the output to be used by SAX transformer. See Also: OutputKeys |
serializeNode | public static String serializeNode(Node node, Properties format) throws ProcessingException(Code) | | Serialize a DOM node into a string.
If the node is null the empty string is returned.
Parameters: format - The format of the output to be used by SAX transformer. See Also: OutputKeys |
serializeNodeToXML | public static String serializeNodeToXML(Node node) throws ProcessingException(Code) | | Serialize a DOM node to a String.
The defaultSerializeToXMLFormat() is used to format the serialized xml.
|
stripDuplicateAttributes | public static void stripDuplicateAttributes(Node node, Node parent)(Code) | | |
valueOf | public static void valueOf(ContentHandler contentHandler, String text) throws SAXException(Code) | | Implementation of <xsp:expr> for String :
outputs characters representing the value.
Parameters: contentHandler - the SAX content handler Parameters: text - the value |
valueOf | public static void valueOf(ContentHandler contentHandler, org.apache.excalibur.xml.sax.XMLizable v) throws SAXException(Code) | | Implementation of <xsp:expr> for XMLizable :
outputs the value by calling v.toSax(contentHandler) .
Parameters: contentHandler - the SAX content handler Parameters: v - the XML fragment |
valueOf | public static void valueOf(ContentHandler contentHandler, Node v) throws SAXException(Code) | | Implementation of <xsp:expr> for org.w3c.dom.Node :
converts the Node to a SAX event stream.
Parameters: contentHandler - the SAX content handler Parameters: v - the value |
valueOf | public static void valueOf(ContentHandler contentHandler, Collection v) throws SAXException(Code) | | Implementation of <xsp:expr> for java.util.Collection :
outputs the value by calling xspExpr() on each element of the
collection.
Parameters: contentHandler - the SAX content handler Parameters: v - the XML fragment |
valueOf | public static void valueOf(ContentHandler contentHandler, Object v) throws SAXException(Code) | | Implementation of <xsp:expr> for Object depending on its class :
- if it's an array, call
xspExpr() on all its elements,
- if it's class has a specific
xspExpr() implementation, use it,
- else, output it's string representation.
Parameters: contentHandler - the SAX content handler Parameters: v - the value |
|
|