[ 
https://issues.apache.org/jira/browse/LANG-359?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12536124
 ] 

Sergey Vladimirov commented on LANG-359:
----------------------------------------

Good day,

My +1 to XMLUtils class. We are using following "common" functions in our 
projects:
Those functions are linked to DOM, but are not linked to Xerces / Xalan

Copy Node to ContentHandler
copy(Node node, ContentHandler handler)

Formatting XML document, with ident
static String formatXML(byte[] xmlDocument)
static String formatXML(InputStream inputStream)
static String formatXML(Node xmlNode)
static String formatXML(Source source)
static void formatXML(final Source source, final Result result)
static String formatXML(String xmlDocument)

Parsing and validation of XML document using specified schema.  Result is 
placed into Holder.
static boolean parseAndValidate(InputSource inputSource, String schemaSource, 
Holder holder)

Retrieving node form Source, parsing if nessecary
static Node toNode(Source source)

Adding elements to XML (due of missing of such functions from DOM interfaces), 
do nothing if value is null
addElement(Element parent, String name, T value)
setAttributeValue(Element element, String name, T value)
where T <= {String, Boolean, Integer, Long, etc}

> Add an XMLUtils class
> ---------------------
>
>                 Key: LANG-359
>                 URL: https://issues.apache.org/jira/browse/LANG-359
>             Project: Commons Lang
>          Issue Type: New Feature
>            Reporter: Ahmed Mohombe
>
> Please add an XMLUtils class that deals with most common functions required 
> in working with XML. Working directly with the w3 DOM is a PITA, and almost 
> every project that needs XML, implements it's own utility classes, hence much 
> repeating and code duplication.
> IMHO this (commons-lang) is the best place for such an utility cause it would 
> be similar to StringUtils (used so much that everybody wishes it were part of 
> the JDK :) )
> Thanks in advance,
> Ahmed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to