org.apache.cocoon.xml
Class XMLUtils

java.lang.Object
  |
  +--org.apache.cocoon.xml.XMLUtils

public class XMLUtils
extends java.lang.Object

XML utility methods.

Version:
CVS $Id: XMLUtils.java,v 1.5 2002/02/22 23:25:19 sylvain Exp $
Author:
Nicola Ken Barozzi, Sylvain Wallez

Constructor Summary
XMLUtils()
           
 
Method Summary
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 void stripDuplicateAttributes(org.w3c.dom.Node node, org.w3c.dom.Node parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtils

public XMLUtils()
Method Detail

stripDuplicateAttributes

public static void stripDuplicateAttributes(org.w3c.dom.Node node,
                                            org.w3c.dom.Node parent)

getConsumer

public static XMLConsumer getConsumer(org.xml.sax.ContentHandler ch,
                                      org.xml.sax.ext.LexicalHandler lh)
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
lh - the lexical handler, which can be null
Returns:
an XMLConsumer for ch an lh

getConsumer

public static XMLConsumer getConsumer(org.xml.sax.ContentHandler ch)
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
Returns:
an XMLConsumer for ch


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.