org.alfresco.web.forms
Class XMLUtil

java.lang.Object
  extended by org.alfresco.web.forms.XMLUtil

public class XMLUtil
extends java.lang.Object

XML utility functions.


Constructor Summary
XMLUtil()
           
 
Method Summary
static java.lang.String buildXPath(org.w3c.dom.Node from, org.w3c.dom.Element to)
          FOR DIAGNOSTIC PURPOSES ONLY - incomplete
Builds a path to the node relative to the to node provided.
static org.w3c.dom.NodeList combine(org.w3c.dom.NodeList[] nls)
          Provides a NodeList of multiple nodelists
static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
          provides a document builder that is namespace aware but not validating by default
static javax.xml.parsers.DocumentBuilder getDocumentBuilder(boolean namespaceAware, boolean validating)
           
static org.w3c.dom.Document newDocument()
          utility function for creating a document
static org.w3c.dom.Document parse(java.io.File source)
          utility function for parsing xml
static org.w3c.dom.Document parse(java.io.InputStream source)
          utility function for parsing xml
static org.w3c.dom.Document parse(int version, java.lang.String path, org.alfresco.service.cmr.avm.AVMService avmService)
          utility function for parsing xml
static org.w3c.dom.Document parse(org.alfresco.service.cmr.repository.NodeRef nodeRef, org.alfresco.service.cmr.repository.ContentService contentService)
          utility function for parsing xml
static org.w3c.dom.Document parse(java.lang.String source)
          utility function for parsing xml
static void print(org.w3c.dom.Node n, java.io.File output)
          utility function for serializing a node
static void print(org.w3c.dom.Node n, java.io.Writer output)
          utility function for serializing a node
static void print(org.w3c.dom.Node n, java.io.Writer output, boolean indent)
          utility function for serializing a node
static java.lang.String toString(org.w3c.dom.Node n)
          utility function for serializing a node
static java.lang.String toString(org.w3c.dom.Node n, boolean indent)
          utility function for serializing a node
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtil

public XMLUtil()
Method Detail

newDocument

public static org.w3c.dom.Document newDocument()
utility function for creating a document


print

public static void print(org.w3c.dom.Node n,
                         java.io.Writer output)
utility function for serializing a node


print

public static void print(org.w3c.dom.Node n,
                         java.io.Writer output,
                         boolean indent)
utility function for serializing a node


print

public static void print(org.w3c.dom.Node n,
                         java.io.File output)
                  throws java.io.IOException
utility function for serializing a node

Throws:
java.io.IOException

toString

public static java.lang.String toString(org.w3c.dom.Node n)
utility function for serializing a node


toString

public static java.lang.String toString(org.w3c.dom.Node n,
                                        boolean indent)
utility function for serializing a node


parse

public static org.w3c.dom.Document parse(java.lang.String source)
                                  throws org.xml.sax.SAXException,
                                         java.io.IOException
utility function for parsing xml

Throws:
org.xml.sax.SAXException
java.io.IOException

parse

public static org.w3c.dom.Document parse(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                         org.alfresco.service.cmr.repository.ContentService contentService)
                                  throws org.xml.sax.SAXException,
                                         java.io.IOException
utility function for parsing xml

Throws:
org.xml.sax.SAXException
java.io.IOException

parse

public static org.w3c.dom.Document parse(int version,
                                         java.lang.String path,
                                         org.alfresco.service.cmr.avm.AVMService avmService)
                                  throws org.xml.sax.SAXException,
                                         java.io.IOException
utility function for parsing xml

Throws:
org.xml.sax.SAXException
java.io.IOException

parse

public static org.w3c.dom.Document parse(java.io.File source)
                                  throws org.xml.sax.SAXException,
                                         java.io.IOException
utility function for parsing xml

Throws:
org.xml.sax.SAXException
java.io.IOException

parse

public static org.w3c.dom.Document parse(java.io.InputStream source)
                                  throws org.xml.sax.SAXException,
                                         java.io.IOException
utility function for parsing xml

Throws:
org.xml.sax.SAXException
java.io.IOException

getDocumentBuilder

public static javax.xml.parsers.DocumentBuilder getDocumentBuilder()
provides a document builder that is namespace aware but not validating by default


buildXPath

public static java.lang.String buildXPath(org.w3c.dom.Node from,
                                          org.w3c.dom.Element to)
FOR DIAGNOSTIC PURPOSES ONLY - incomplete
Builds a path to the node relative to the to node provided.

Parameters:
from - the node from which to build the xpath
to - an ancestor of from which will be the root of the path
Returns:
an xpath to to rooted at from.

getDocumentBuilder

public static javax.xml.parsers.DocumentBuilder getDocumentBuilder(boolean namespaceAware,
                                                                   boolean validating)

combine

public static org.w3c.dom.NodeList combine(org.w3c.dom.NodeList[] nls)
Provides a NodeList of multiple nodelists



Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.