org.exist.util
Class XMLUtil

java.lang.Object
  extended byorg.exist.util.XMLUtil

public class XMLUtil
extends java.lang.Object

Description of the Class

Author:
Wolfgang Meier

Constructor Summary
XMLUtil()
           
 
Method Summary
static void copyChildren(org.w3c.dom.Document new_doc, org.w3c.dom.Node node, org.w3c.dom.Node new_node)
          Description of the Method
static org.w3c.dom.Node copyNode(org.w3c.dom.Document new_doc, org.w3c.dom.Node node)
          Description of the Method
static java.lang.String decodeAttrMarkup(java.lang.String str)
           
static java.lang.String dump(org.w3c.dom.DocumentFragment fragment)
           
static java.lang.String encodeAttrMarkup(java.lang.String str)
          Description of the Method
static java.lang.String exceptionToString(java.lang.Throwable e)
          Description of the Method
static java.lang.String getEncoding(java.lang.String xmlDecl)
          Gets the encoding attribute of the XMLUtil class
static long getFirstChildId(DocumentImpl doc, long gid)
           
static long getFirstChildId(DocumentImpl doc, long gid, int level)
          Gets the firstChildId attribute of the XMLUtil class
static long getParentId(DocumentImpl doc, long gid)
           
static long getParentId(DocumentImpl doc, long gid, int level)
           
static java.lang.String getXMLDecl(byte[] data)
          Gets the encoding attribute of the XMLUtil class
static boolean isDescendantOrSelf(DocumentImpl doc, long ancestor, long descendant)
           
static void main(java.lang.String[] args)
          The main program for the XMLUtil class
static java.lang.String parseValue(java.lang.String value, int p)
           
static java.lang.String parseValue(java.lang.String value, java.lang.String key)
           
static java.lang.String readFile(java.io.File file)
          Description of the Method
static java.lang.String readFile(java.io.File file, java.lang.String defaultEncoding)
          Description of the Method
static java.lang.String readFile(java.io.InputStream in, java.lang.String defaultEncoding)
           
 
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

dump

public static final java.lang.String dump(org.w3c.dom.DocumentFragment fragment)

copyChildren

public static final void copyChildren(org.w3c.dom.Document new_doc,
                                      org.w3c.dom.Node node,
                                      org.w3c.dom.Node new_node)
Description of the Method

Parameters:
new_doc - Description of the Parameter
node - Description of the Parameter
new_node - Description of the Parameter

copyNode

public static final org.w3c.dom.Node copyNode(org.w3c.dom.Document new_doc,
                                              org.w3c.dom.Node node)
Description of the Method

Parameters:
new_doc - Description of the Parameter
node - Description of the Parameter
Returns:
Description of the Return Value

encodeAttrMarkup

public static final java.lang.String encodeAttrMarkup(java.lang.String str)
Description of the Method

Parameters:
str - Description of the Parameter
Returns:
Description of the Return Value

decodeAttrMarkup

public static final java.lang.String decodeAttrMarkup(java.lang.String str)

exceptionToString

public static final java.lang.String exceptionToString(java.lang.Throwable e)
Description of the Method

Parameters:
e - Description of the Parameter
Returns:
Description of the Return Value

getEncoding

public static final java.lang.String getEncoding(java.lang.String xmlDecl)
Gets the encoding attribute of the XMLUtil class

Parameters:
xmlDecl - Description of the Parameter
Returns:
The encoding value

getFirstChildId

public static final long getFirstChildId(DocumentImpl doc,
                                         long gid)

getFirstChildId

public static final long getFirstChildId(DocumentImpl doc,
                                         long gid,
                                         int level)
Gets the firstChildId attribute of the XMLUtil class

Parameters:
doc - Description of the Parameter
gid - Description of the Parameter
Returns:
The firstChildId value

getParentId

public static final long getParentId(DocumentImpl doc,
                                     long gid)

getParentId

public static final long getParentId(DocumentImpl doc,
                                     long gid,
                                     int level)

isDescendantOrSelf

public static final boolean isDescendantOrSelf(DocumentImpl doc,
                                               long ancestor,
                                               long descendant)

getXMLDecl

public static final java.lang.String getXMLDecl(byte[] data)
Gets the encoding attribute of the XMLUtil class

Parameters:
data - Description of the Parameter
Returns:
The encoding value

main

public static void main(java.lang.String[] args)
The main program for the XMLUtil class

Parameters:
args - The command line arguments

readFile

public static final java.lang.String readFile(java.io.File file)
                                       throws java.io.IOException
Description of the Method

Parameters:
file - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

readFile

public static java.lang.String readFile(java.io.File file,
                                        java.lang.String defaultEncoding)
                                 throws java.io.IOException
Description of the Method

Parameters:
file - Description of the Parameter
defaultEncoding - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception

readFile

public static java.lang.String readFile(java.io.InputStream in,
                                        java.lang.String defaultEncoding)
                                 throws java.io.IOException
Throws:
java.io.IOException

parseValue

public static java.lang.String parseValue(java.lang.String value,
                                          java.lang.String key)

parseValue

public static java.lang.String parseValue(java.lang.String value,
                                          int p)


Copyright (C) Wolfgang Meier. All rights reserved.