cookxml.core.util
Class IncludeUtils

java.lang.Object
  extended bycookxml.core.util.IncludeUtils

public class IncludeUtils
extends Object

Since:
CookXml 2.0

Constructor Summary
IncludeUtils()
           
 
Method Summary
static DocumentElement getElement(String includeStr, ClassLoader classLoader, Document docRoot, DocumentBuilder builder)
          This function is used to find the element to be included.
static DocumentElement getElement(String includeStr, DecodeEngine decodeEngine)
          This function is used to find the element to be included.
static DocumentElement getElement(String includeStr, Document docRoot, DocumentBuilder builder)
          This function is used to find the element to be included.
static Element getElementById(Element rootElm, String id)
          This function retrieves the element in the document that has the given id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncludeUtils

public IncludeUtils()
Method Detail

getElement

public static DocumentElement getElement(String includeStr,
                                         DecodeEngine decodeEngine)
                                  throws Exception
This function is used to find the element to be included.

Parameters:
includeStr - the "pointer" to the element to be added.
decodeEngine - the DecodeEngine that is being used.
Returns:
the element retrieved.
Throws:
Exception

getElement

public static DocumentElement getElement(String includeStr,
                                         Document docRoot,
                                         DocumentBuilder builder)
                                  throws Exception
This function is used to find the element to be included.

Parameters:
includeStr - the "pointer" to the element to be added.
builder - the XML parser.
docRoot - the root of the current document.
Returns:
the element retrieved.
Throws:
Exception

getElement

public static DocumentElement getElement(String includeStr,
                                         ClassLoader classLoader,
                                         Document docRoot,
                                         DocumentBuilder builder)
                                  throws Exception
This function is used to find the element to be included.

Parameters:
includeStr - the "pointer" to the element to be added.
builder - the XML parser.
docRoot - the root of the current document.
Returns:
the element retrieved.
Throws:
Exception

getElementById

public static Element getElementById(Element rootElm,
                                     String id)
This function retrieves the element in the document that has the given id. It seems to be a known problem for parsing XML documents without DTD. So, this is a workaround.

Parameters:
rootElm - the current root
id - the id
Returns:
the first element found.