|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.cocoon.xml.XMLUtils
XML utility methods.
Field Summary | |
static java.lang.String |
xalanBugStylesheet
|
Constructor Summary | |
XMLUtils()
|
Method Summary | |
static void |
data(org.xml.sax.ContentHandler contentHandler,
java.lang.String data)
Add string data |
static java.util.Properties |
defaultSerializeToXMLFormat()
This is the default properties set used to serialize xml. |
static java.util.Properties |
defaultSerializeToXMLFormat(boolean omitXMLDeclaration)
This is the default properties set used to serialize xml. |
static XMLConsumer |
getConsumer(org.xml.sax.ContentHandler ch)
Get an XMLConsumer from ContentHandler . |
static XMLConsumer |
getConsumer(org.xml.sax.ContentHandler ch,
org.xml.sax.ext.LexicalHandler lh)
Get an XMLConsumer from a ContentHandler and
a LexicalHandler . |
static java.lang.String |
serializeNode(org.w3c.dom.Node node,
java.util.Properties format)
Serialize a DOM node to a String. |
static java.lang.String |
serializeNodeToXML(org.w3c.dom.Node node)
Serialize a DOM node to a String. |
static void |
stripDuplicateAttributes(org.w3c.dom.Node node,
org.w3c.dom.Node parent)
|
static void |
valueOf(org.xml.sax.ContentHandler contentHandler,
java.util.Collection v)
Implementation of <xsp:expr> for java.util.Collection :
outputs the value by calling xspExpr() on each element of the
collection. |
static void |
valueOf(org.xml.sax.ContentHandler contentHandler,
org.w3c.dom.Node v)
Implementation of <xsp:expr> for org.w3c.dom.Node :
converts the Node to a SAX event stream. |
static void |
valueOf(org.xml.sax.ContentHandler contentHandler,
java.lang.Object v)
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.
|
static void |
valueOf(org.xml.sax.ContentHandler contentHandler,
java.lang.String text)
Implementation of <xsp:expr> for String :
outputs characters representing the value. |
static void |
valueOf(org.xml.sax.ContentHandler contentHandler,
XMLizable v)
Implementation of <xsp:expr> for XMLizable :
outputs the value by calling v.toSax(contentHandler) . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.lang.String xalanBugStylesheet
Constructor Detail |
public XMLUtils()
Method Detail |
public static void stripDuplicateAttributes(org.w3c.dom.Node node, org.w3c.dom.Node parent)
public static XMLConsumer getConsumer(org.xml.sax.ContentHandler ch, org.xml.sax.ext.LexicalHandler lh)
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.ch
- the content handler, which should not be null
lh
- the lexical handler, which can be null
XMLConsumer
for ch
an lh
public static XMLConsumer getConsumer(org.xml.sax.ContentHandler ch)
XMLConsumer
from ContentHandler
. If the
content handler is already an XMLConsumer
, it is returned as
is, otherwise it is wrapped in an XMLConsumer
.ch
- the content handler, which should not be null
XMLConsumer
for ch
public static java.lang.String serializeNodeToXML(org.w3c.dom.Node node) throws ProcessingException
public static java.util.Properties defaultSerializeToXMLFormat()
public static java.util.Properties defaultSerializeToXMLFormat(boolean omitXMLDeclaration)
public static java.lang.String serializeNode(org.w3c.dom.Node node, java.util.Properties format) throws ProcessingException
public static void data(org.xml.sax.ContentHandler contentHandler, java.lang.String data) throws org.xml.sax.SAXException
contentHandler
- The SAX content handlerdata
- The string datapublic static void valueOf(org.xml.sax.ContentHandler contentHandler, java.lang.String text) throws org.xml.sax.SAXException
String
:
outputs characters representing the value.contentHandler
- the SAX content handlertext
- the valuepublic static void valueOf(org.xml.sax.ContentHandler contentHandler, XMLizable v) throws org.xml.sax.SAXException
XMLizable
:
outputs the value by calling v.toSax(contentHandler)
.contentHandler
- the SAX content handlerv
- the XML fragmentpublic static void valueOf(org.xml.sax.ContentHandler contentHandler, org.w3c.dom.Node v) throws org.xml.sax.SAXException
org.w3c.dom.Node
:
converts the Node to a SAX event stream.contentHandler
- the SAX content handlerv
- the valuepublic static void valueOf(org.xml.sax.ContentHandler contentHandler, java.util.Collection v) throws org.xml.sax.SAXException
java.util.Collection
:
outputs the value by calling xspExpr()
on each element of the
collection.contentHandler
- the SAX content handlerv
- the XML fragmentpublic static void valueOf(org.xml.sax.ContentHandler contentHandler, java.lang.Object v) throws org.xml.sax.SAXException
Object
depending on its class :
xspExpr()
on all its elements,xspExpr()
implementation, use it,contentHandler
- the SAX content handlerv
- the value
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |