com.jaxfront.core.dom
Class DOMHelper

java.lang.Object
  extended by com.jaxfront.core.dom.DOMHelper

public class DOMHelper
extends java.lang.Object

Helper class for any kind of W3C DOM operations. The DOMHelper is using the XML DOMParser from Oracle.

Version:
1.60

Field Summary
static java.lang.String DOCUMENTATION_START
           
static java.lang.String XMLNS
           
 
Method Summary
static boolean containsValue(ListType list, java.lang.String value)
           
static int countEditingTypeSubNodes(Type type)
           
static int countNodeDepth(Type type)
           
static int countSubNodes(SchemaNode node)
           
static int countSubNodes(SchemaNode node, java.util.Hashtable recursionHash)
           
static int countSubNodes(Type type)
           
static Type createBranchFromEditingTypes(java.util.List edTypes)
           
static org.w3c.dom.Document createDocument(java.io.File file)
          Creates a W3C DOM out of an URL.
static org.w3c.dom.Document createDocument(org.xml.sax.InputSource is)
           
static org.w3c.dom.Document createDocument(java.io.InputStream is)
          Creates a W3C DOM out of an InputStream.
static org.w3c.dom.Document createDocument(org.w3c.dom.ls.LSInput xml)
           
static org.w3c.dom.Document createDocument(java.io.Reader reader)
           
static org.w3c.dom.Document createDocument(java.lang.String content)
          Creates a W3C DOM out of a simple String.
static org.w3c.dom.Document createDocument(java.lang.StringBuffer content)
          Creates a W3C DOM out of a simple String.
static org.w3c.dom.Document createDocument(java.lang.String content, org.xml.sax.ErrorHandler handler)
          Creates a W3C DOM out of a simple String.
static org.w3c.dom.Document createDocument(java.net.URL url)
          Creates a W3C DOM out of an URL.
static void createFromEditingTypeXPath(Type start, java.lang.String xpath)
           
static void createInfoListXPath(Type from, java.lang.StringBuffer px, int level)
           
static java.lang.StringBuffer createInfoXPath(Type from, int level, boolean breakAtFirstList, boolean breakAtFirstComposite)
           
static void createInfoXPath(Type from, java.lang.StringBuffer px, int level, boolean breakAtFirstList, boolean breakAtFirstComposite)
           
static boolean equalsTypeElement(XMLSchema schema, org.w3c.dom.Node instanceElement, Type aType, boolean ignoreNS)
           
static boolean equalsTypeElement(XMLSchema schema, java.lang.String defaultNS, org.w3c.dom.Node instanceElement, java.lang.String typeName, java.lang.String typeNameSpace, boolean ignoreNS)
           
static void evalGlobalTypes(Type type, java.util.Vector resultTypes, java.util.Map globalTypes, java.util.Stack buff, java.util.Vector resultXPaths)
          Returns a list of all parents which are global types.
static void evalGlobalTypes(Type type, java.util.Vector resultTypes, java.util.Vector resultXPaths)
           
static void evalGlobalTypesElementBased(Type type, java.util.Vector resultTypes, java.util.Map globalTypes, java.util.Stack buff, java.util.Vector resultXPaths)
           
static void evalGlobalTypesGlobalRefBased(Type type, java.util.Vector resultTypes, java.util.Map globalTypes, java.util.Stack buff, java.util.Vector resultXPaths)
           
static void evalGlobalTypesRefBased(SchemaNode schemaNode, java.util.Vector resultTypes, java.util.Map globalTypes, java.util.Stack buff, java.util.Vector resultXPaths)
           
static java.util.Hashtable extractAnnotation(org.apache.xerces.xs.XSAnnotation annotationObject)
           
static java.util.Hashtable extractData(org.w3c.dom.Document dom, java.lang.String tagName)
           
static java.lang.String extractSchemaLocation(java.net.URL loadedFrom, java.lang.String schemaLocation, java.lang.String targetNS)
           
static java.lang.String formatPI(org.w3c.dom.Node node)
           
static java.lang.String getAbsoluteXPath(Type type)
           
static java.lang.String getAdditionalXMLHeaderAttribs(Document dom)
           
static java.lang.String getAdditionalXUIHeaderAttribs(Document dom)
           
static java.util.List getAllChilds(Type aStartType)
           
static java.util.List getAllChilds(Type aStartType, boolean includingStartType)
           
static void getAllChilds(Type aStartType, java.lang.String name, java.lang.String ns, java.util.List result)
           
static void getAllIncludedURLs(java.net.URL xsdURL, java.util.List includeList, boolean onlyValue, boolean rootIncluded)
           
static java.util.List getAllListChilds(Type aStartType, boolean onlyDirect)
           
static java.util.Hashtable getAllSchemaBaseAttributes(org.w3c.dom.Document dom)
           
static java.util.Hashtable getAllSchemaBaseAttributes(java.lang.String xsdString)
           
static java.util.Hashtable getAllSchemaBaseAttributes(java.net.URL xsdURL)
           
static java.util.List getAllVisStructureChilds(Type aStartType, boolean includingStartType)
           
static java.lang.String getAnnotation(Type type)
           
static org.w3c.dom.Element getChild(XMLSchema schema, org.w3c.dom.Element element, java.lang.String name)
          Returns the first child element whith a given name.
static org.w3c.dom.Element getChild(XMLSchema schema, org.w3c.dom.Element element, java.lang.String[] name)
          Returns the first child element which maps to one of the names passed in a String array.
static org.w3c.dom.Element getChild(XMLSchema schema, org.w3c.dom.Element element, java.lang.String[] name, int index)
          Returns the first child element which maps to one of the names passed in a String array.
static org.w3c.dom.Element getChild(XMLSchema schema, org.w3c.dom.Element element, java.lang.String name, int index)
          Returns the first child element whith a given name.
static org.w3c.dom.Element getChild(XMLSchema schema, org.w3c.dom.Element element, java.lang.String namespace, java.lang.String defaultNS, java.lang.String name, int index)
          Returns the first child element which maps to one of the names passed in a String array.
static org.w3c.dom.Element getChild(XMLSchema schema, org.w3c.dom.Element element, Type aType)
           
static java.util.List getChildren(XMLSchema schema, org.w3c.dom.Element element)
          Returns a list of child elements.
static java.util.List getChildren(XMLSchema schema, org.w3c.dom.Element element, java.lang.String name)
          Returns a list of child elements for a given name.
static java.util.List getChildren(XMLSchema schema, org.w3c.dom.Element element, java.lang.String namespace, java.lang.String defaultNS, java.lang.String name)
          Returns a list of child elements for a given name.
static java.util.List getChildren(XMLSchema schema, org.w3c.dom.Element element, Type aType)
          Returns a list of child elements for a given name.
static java.lang.String getChildText(XMLSchema schema, org.w3c.dom.Element element, java.lang.String name)
          Returns the text content for a given element a given child name.
static Type getComplexParent(Type aChildType)
           
static java.lang.String getConditionalXPathHolder(java.lang.String xpath)
           
static java.lang.String getDefaultNameSpace(org.w3c.dom.Document dom)
           
static Type getDerivedType(Type abstractType, java.lang.String name, boolean makeCopy)
           
static java.lang.String getDocElementValue(org.w3c.dom.Document dom, java.lang.String key)
           
static java.util.List getEditingTypeParentPath(Type start)
           
static java.lang.String getEncoding(org.w3c.dom.Document dom)
          Returns the encoding of a document.
static java.lang.String getEnumerationAnnotation(Type type, java.lang.String enumName)
           
static org.w3c.dom.Element getFirstChild(org.w3c.dom.Element element)
          Returns the first child element whith a given name.
static java.lang.String getGlobalAddressFromXPath(java.lang.String xpath)
          Returns just the relative address of a global addressed XUI component.
static java.lang.String getGlobalNameFromXPath(java.lang.String xpath)
          Returns just the name of a global addressed XUI component. e.q.
static java.lang.String[] getGlobalParentXPathsUpTo(Type type)
          Returns an array of all global parent xpaths based on a passing type.
static java.lang.String getGlobalParentXPathUpTo(Type globalType, Type type, java.lang.String xpath)
          Returns an XPath from a starting type upto a global parent type.
static java.util.Vector getGlobalTypes(Type type)
          Returns a list of all parents which are global types.
static Document getJAXFormsDOM(java.lang.String context, java.util.Hashtable metaInfo)
           
static java.util.List getLockedTypes(Type rootType, java.lang.String xpath)
           
static java.lang.String getMixedContentText(org.w3c.dom.Element element)
          Returns the last text content of an element
static org.w3c.dom.Node getMixedTextNode(org.w3c.dom.Element element)
          Return a mixed text content (first or last) test node.
static java.util.Vector getNamespaceDeclarations(java.util.Hashtable nameSpaces, boolean isXuiDom, boolean forceSerialization, java.lang.String defaultNameSpace)
           
static java.util.Hashtable getNameSpaces(org.w3c.dom.Document dom)
           
static java.lang.String getNameSpaceSchemaLocation(org.w3c.dom.Document dom)
           
static java.util.Hashtable getNameSpaceToPrefixMapping(org.w3c.dom.Document dom)
           
static java.lang.String getNoNameSpaceSchemaLocation(org.w3c.dom.Document dom)
           
static void getPlainXPath(SchemaNode node, java.lang.StringBuffer px)
           
static void getPlainXPath(Type type, java.lang.StringBuffer px)
           
static java.lang.String getPrefixForNamespace(org.w3c.dom.Document doc, java.lang.String nameSpace)
           
static org.w3c.dom.ProcessingInstruction getProcessingInstruction(org.w3c.dom.Node node)
           
static java.util.Vector getProcessingInstructions(org.w3c.dom.Node startNode)
           
static org.w3c.dom.Node getProcessingInstructionTarget(org.w3c.dom.Node startNode, java.lang.String target)
          Gets the value of a given processing instruction.
static java.lang.String getProcessingInstructionValue(org.w3c.dom.Node startNode, java.lang.String target)
          Gets the value of a given processing instruction.
static java.lang.String getProcessingInstructionValue(org.w3c.dom.Node startNode, java.lang.String target, java.lang.String attribute)
          Gets the value of a given processing instruction attribute.
static java.lang.String getQualifiedElementName(XMLSchema schema, org.w3c.dom.Element element)
           
static java.lang.String getQualifiedElementName(XMLSchema schema, org.w3c.dom.Node element)
           
static Type getRecursiveParent(Type aType, boolean startWithCurrent)
           
static java.lang.String getRelativeEditingTypeXPath(Type startType, Type editingType)
           
static java.lang.String getRelativeXPathLocation(Type type)
          Returns an xpath which removes all indexed components like [1] and JAXFront specific xpath additions like [list].
static java.lang.String getRelativeXPathLocation(Type type, java.lang.String xpath)
          Returns an xpath which removes all indexed components like [1].
static java.lang.String getSchemaXPath(SchemaNode sNode)
           
static java.lang.String getText(org.w3c.dom.Element element)
          Returns the text content of an element
static org.w3c.dom.Node getTextNode(org.w3c.dom.Element element)
          Return the text node from a W3C element.
static java.util.List getTypeChildren(Type aType, java.lang.String name)
          Returns all ChildTypes (recursive) for a given name!
static void getTypeChildren(Type aType, java.lang.String name, java.util.List result)
          Returns all ChildTypes for a given name!
static java.lang.String getValueFromXPath(java.lang.String xpath, Type root)
          Returns the value of an addressed leaf type through an xpath statement or null if xpath does not evaluate a target node.
static java.lang.String[] getValues(ListType list)
           
static Document getXMLDBMappingDOM(java.lang.String context, java.net.URL xsdURL, java.net.URL xuiURL)
           
static java.lang.String getXMLHeaderAttribs(Document dom, java.util.Map attribs)
           
static java.util.Hashtable getXMLHeaderAttributes(org.w3c.dom.Document dom)
           
static java.lang.String getXMLProcessingInstructionValue(org.w3c.dom.Document document, java.lang.String target, java.lang.String attribute)
           
static java.lang.String getXPathForRecursion(Type aType)
           
static boolean hasAnonymousChildren(Type aType)
           
static boolean hasRecursiveParent(Type aType)
           
static boolean isJAXFrontXSDSchema(java.net.URL xsdURL)
           
static boolean isMandatoryWithinAnonymousGroup(Type type, boolean checkGroupIndex)
           
static void merge(XMLSchema schema, org.w3c.dom.Node originalParentNode, org.w3c.dom.Node nodeToMerge)
           
static void mergeSchemaWithIncludedSchemas(java.net.URL xsdURL, org.w3c.dom.Document baseDoc, boolean isRoot, java.lang.String startXSDPrefix)
           
static void performLateBind(Type targetType, org.w3c.dom.Element dataSource)
           
static void resetListViews(Type type)
           
static java.lang.String serialize(org.w3c.dom.Document dom)
          Serializes a W3C DOM to a string.
static java.lang.String serializeElement(org.w3c.dom.Element elmt)
          Serializes a W3C Element to a string.
static void setText(org.w3c.dom.Element element, java.lang.String text)
          Set a text to any W3C element node.
static Document updateJAXFormsDOM(Document jaxformsDOM, Document targetDOM, org.w3c.dom.Document xmlDataDOM, Document xuiDOM, Document pdfXUIDOM, java.net.URL xsdURL, java.net.URL xuiURL, NLS nls, java.net.URL xmlURL)
           
static java.util.List vizualizerSelectorTypePathForFocus(Type startElement)
           
static Type walkTypeXpath(java.lang.String xpath, Type start)
           
static Type walkTypeXpath(java.lang.String xpath, Type start, boolean edTypeTraverseOnly)
           
static void write(java.lang.StringBuffer buffer, java.io.File file)
          Writes the content of a StringBuffer to a file.
static void write(java.lang.StringBuffer buffer, java.io.File file, java.lang.String encoding)
           
static void write(java.lang.StringBuffer buffer, java.io.Writer writer)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XMLNS

public static final java.lang.String XMLNS

DOCUMENTATION_START

public static final java.lang.String DOCUMENTATION_START
See Also:
Constant Field Values
Method Detail

createDocument

public static org.w3c.dom.Document createDocument(java.net.URL url)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Creates a W3C DOM out of an URL.

Parameters:
url - to create W3C DOM from
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

createDocument

public static org.w3c.dom.Document createDocument(java.io.File file)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Creates a W3C DOM out of an URL.

Parameters:
url - to create W3C DOM from
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

isJAXFrontXSDSchema

public static boolean isJAXFrontXSDSchema(java.net.URL xsdURL)

createDocument

public static org.w3c.dom.Document createDocument(java.io.InputStream is)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Creates a W3C DOM out of an InputStream.

Parameters:
is - InputStream to create W3C DOM from
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

createDocument

public static org.w3c.dom.Document createDocument(org.w3c.dom.ls.LSInput xml)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

createDocument

public static org.w3c.dom.Document createDocument(org.xml.sax.InputSource is)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

createFromEditingTypeXPath

public static void createFromEditingTypeXPath(Type start,
                                              java.lang.String xpath)

createDocument

public static org.w3c.dom.Document createDocument(java.lang.String content)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Creates a W3C DOM out of a simple String.

Parameters:
content - String content
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

createDocument

public static org.w3c.dom.Document createDocument(java.lang.String content,
                                                  org.xml.sax.ErrorHandler handler)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Creates a W3C DOM out of a simple String.

Parameters:
content - String content
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

createDocument

public static org.w3c.dom.Document createDocument(java.lang.StringBuffer content)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Creates a W3C DOM out of a simple String.

Parameters:
content - String content
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

getTypeChildren

public static void getTypeChildren(Type aType,
                                   java.lang.String name,
                                   java.util.List result)
Returns all ChildTypes for a given name!

See Also:
Type.getChild(java.lang.String)

getTypeChildren

public static java.util.List getTypeChildren(Type aType,
                                             java.lang.String name)
Returns all ChildTypes (recursive) for a given name!

See Also:
Type.getChild(java.lang.String)

getXPathForRecursion

public static java.lang.String getXPathForRecursion(Type aType)

hasAnonymousChildren

public static boolean hasAnonymousChildren(Type aType)

getRecursiveParent

public static Type getRecursiveParent(Type aType,
                                      boolean startWithCurrent)

hasRecursiveParent

public static boolean hasRecursiveParent(Type aType)

getChild

public static org.w3c.dom.Element getChild(XMLSchema schema,
                                           org.w3c.dom.Element element,
                                           java.lang.String[] name)
Returns the first child element which maps to one of the names passed in a String array.

Parameters:
element - start element
name - array of names

getChild

public static org.w3c.dom.Element getChild(XMLSchema schema,
                                           org.w3c.dom.Element element,
                                           Type aType)

getChild

public static org.w3c.dom.Element getChild(XMLSchema schema,
                                           org.w3c.dom.Element element,
                                           java.lang.String namespace,
                                           java.lang.String defaultNS,
                                           java.lang.String name,
                                           int index)
Returns the first child element which maps to one of the names passed in a String array.

Parameters:
element - start element
name - array of names

equalsTypeElement

public static boolean equalsTypeElement(XMLSchema schema,
                                        org.w3c.dom.Node instanceElement,
                                        Type aType,
                                        boolean ignoreNS)

equalsTypeElement

public static boolean equalsTypeElement(XMLSchema schema,
                                        java.lang.String defaultNS,
                                        org.w3c.dom.Node instanceElement,
                                        java.lang.String typeName,
                                        java.lang.String typeNameSpace,
                                        boolean ignoreNS)

getChild

public static org.w3c.dom.Element getChild(XMLSchema schema,
                                           org.w3c.dom.Element element,
                                           java.lang.String[] name,
                                           int index)
Returns the first child element which maps to one of the names passed in a String array.

Parameters:
element - start element
name - array of names

getQualifiedElementName

public static java.lang.String getQualifiedElementName(XMLSchema schema,
                                                       org.w3c.dom.Element element)

getQualifiedElementName

public static java.lang.String getQualifiedElementName(XMLSchema schema,
                                                       org.w3c.dom.Node element)

getChild

public static org.w3c.dom.Element getChild(XMLSchema schema,
                                           org.w3c.dom.Element element,
                                           java.lang.String name)
Returns the first child element whith a given name.

Parameters:
element - start element
name - name to look for

getChild

public static org.w3c.dom.Element getChild(XMLSchema schema,
                                           org.w3c.dom.Element element,
                                           java.lang.String name,
                                           int index)
Returns the first child element whith a given name.

Parameters:
element - start element
name - name to look for

getChildren

public static java.util.List getChildren(XMLSchema schema,
                                         org.w3c.dom.Element element,
                                         Type aType)
Returns a list of child elements for a given name.

Parameters:
element - start element
name - name to look for

getChildren

public static java.util.List getChildren(XMLSchema schema,
                                         org.w3c.dom.Element element,
                                         java.lang.String namespace,
                                         java.lang.String defaultNS,
                                         java.lang.String name)
Returns a list of child elements for a given name.

Parameters:
element - start element
name - name to look for

getChildren

public static java.util.List getChildren(XMLSchema schema,
                                         org.w3c.dom.Element element,
                                         java.lang.String name)
Returns a list of child elements for a given name.

Parameters:
element - start element
name - name to look for

getChildText

public static java.lang.String getChildText(XMLSchema schema,
                                            org.w3c.dom.Element element,
                                            java.lang.String name)
Returns the text content for a given element a given child name.

Parameters:
element - start element
name - child name

getFirstChild

public static org.w3c.dom.Element getFirstChild(org.w3c.dom.Element element)
Returns the first child element whith a given name.

Parameters:
element - start element

getText

public static java.lang.String getText(org.w3c.dom.Element element)
Returns the text content of an element

Parameters:
element - W3C element to get the text content from

getMixedContentText

public static java.lang.String getMixedContentText(org.w3c.dom.Element element)
Returns the last text content of an element

Parameters:
element - W3C element to get the text content from

getTextNode

public static org.w3c.dom.Node getTextNode(org.w3c.dom.Element element)
Return the text node from a W3C element. Text node are always at first position within an element. If no text node exists, an empty text node will be created an attached to the passing element.

Parameters:
element - to look for its text node

getMixedTextNode

public static org.w3c.dom.Node getMixedTextNode(org.w3c.dom.Element element)
Return a mixed text content (first or last) test node.

Parameters:
element - to look for its text node

serializeElement

public static java.lang.String serializeElement(org.w3c.dom.Element elmt)
Serializes a W3C Element to a string.

Parameters:
dom - W3C Element to serialize

serialize

public static java.lang.String serialize(org.w3c.dom.Document dom)
Serializes a W3C DOM to a string.

Parameters:
dom - W3C DOM to serialize

setText

public static void setText(org.w3c.dom.Element element,
                           java.lang.String text)
Set a text to any W3C element node.

Parameters:
element - W3C element node to set a text
text - to set

getEncoding

public static java.lang.String getEncoding(org.w3c.dom.Document dom)
Returns the encoding of a document.

Parameters:
dom - a W3C document
Returns:
the encoding of the current document

write

public static void write(java.lang.StringBuffer buffer,
                         java.io.Writer writer)
                  throws java.io.IOException
Throws:
java.io.IOException

getValues

public static java.lang.String[] getValues(ListType list)

write

public static void write(java.lang.StringBuffer buffer,
                         java.io.File file)
Writes the content of a StringBuffer to a file.

Parameters:
buffer - content
file - file to write

write

public static void write(java.lang.StringBuffer buffer,
                         java.io.File file,
                         java.lang.String encoding)
                  throws java.io.IOException
Throws:
java.io.IOException

getProcessingInstructionTarget

public static org.w3c.dom.Node getProcessingInstructionTarget(org.w3c.dom.Node startNode,
                                                              java.lang.String target)
Gets the value of a given processing instruction.

Parameters:
startNode - the Document to be searched
target - the name of the processing instruction
Returns:
the value of the processing instruction.

getNoNameSpaceSchemaLocation

public static java.lang.String getNoNameSpaceSchemaLocation(org.w3c.dom.Document dom)

getNameSpaceSchemaLocation

public static java.lang.String getNameSpaceSchemaLocation(org.w3c.dom.Document dom)

getDocElementValue

public static java.lang.String getDocElementValue(org.w3c.dom.Document dom,
                                                  java.lang.String key)

getProcessingInstructionValue

public static java.lang.String getProcessingInstructionValue(org.w3c.dom.Node startNode,
                                                             java.lang.String target)
Gets the value of a given processing instruction.

Parameters:
startNode - the Document to be searched
target - the name of the processing instruction
Returns:
the value of the processing instruction.

getProcessingInstructions

public static java.util.Vector getProcessingInstructions(org.w3c.dom.Node startNode)

getProcessingInstruction

public static org.w3c.dom.ProcessingInstruction getProcessingInstruction(org.w3c.dom.Node node)

formatPI

public static java.lang.String formatPI(org.w3c.dom.Node node)

getProcessingInstructionValue

public static java.lang.String getProcessingInstructionValue(org.w3c.dom.Node startNode,
                                                             java.lang.String target,
                                                             java.lang.String attribute)
Gets the value of a given processing instruction attribute.

Parameters:
startNode - the Document to be searched
target - the name of the processing instruction
attribute - the name of the attribute
Returns:
the value of the processing instruction attribute.

getXMLProcessingInstructionValue

public static java.lang.String getXMLProcessingInstructionValue(org.w3c.dom.Document document,
                                                                java.lang.String target,
                                                                java.lang.String attribute)

getGlobalNameFromXPath

public static java.lang.String getGlobalNameFromXPath(java.lang.String xpath)
Returns just the name of a global addressed XUI component. e.q. global:USAddress/name will return just the name USAddress

Parameters:
xpath - potential global xpath used to address global XUI definitions

getGlobalAddressFromXPath

public static java.lang.String getGlobalAddressFromXPath(java.lang.String xpath)
Returns just the relative address of a global addressed XUI component. e.q. global:USAddress/name will return just './name'

Parameters:
xpath - potential global xpath used to address global XUI definitions

getRelativeXPathLocation

public static java.lang.String getRelativeXPathLocation(Type type)
Returns an xpath which removes all indexed components like [1] and JAXFront specific xpath additions like [list].

Parameters:
type - type to create relative xpath from

getRelativeXPathLocation

public static java.lang.String getRelativeXPathLocation(Type type,
                                                        java.lang.String xpath)
Returns an xpath which removes all indexed components like [1].

Parameters:
type - type to create relative xpath from

getPlainXPath

public static void getPlainXPath(Type type,
                                 java.lang.StringBuffer px)

getPlainXPath

public static void getPlainXPath(SchemaNode node,
                                 java.lang.StringBuffer px)

createInfoXPath

public static java.lang.StringBuffer createInfoXPath(Type from,
                                                     int level,
                                                     boolean breakAtFirstList,
                                                     boolean breakAtFirstComposite)

createInfoListXPath

public static void createInfoListXPath(Type from,
                                       java.lang.StringBuffer px,
                                       int level)

createInfoXPath

public static void createInfoXPath(Type from,
                                   java.lang.StringBuffer px,
                                   int level,
                                   boolean breakAtFirstList,
                                   boolean breakAtFirstComposite)

getComplexParent

public static Type getComplexParent(Type aChildType)

getValueFromXPath

public static java.lang.String getValueFromXPath(java.lang.String xpath,
                                                 Type root)
Returns the value of an addressed leaf type through an xpath statement or null if xpath does not evaluate a target node.

Parameters:
xpath - xpath addressing a leaf node
root - relative type to start from

getRelativeEditingTypeXPath

public static java.lang.String getRelativeEditingTypeXPath(Type startType,
                                                           Type editingType)

getGlobalParentXPathUpTo

public static java.lang.String getGlobalParentXPathUpTo(Type globalType,
                                                        Type type,
                                                        java.lang.String xpath)
Returns an XPath from a starting type upto a global parent type.

Parameters:
globalType - global type to lookup xpath
type - starting type to figure out xpath (up to global type)
xpath - current xpath builded so far (recursive)

extractAnnotation

public static java.util.Hashtable extractAnnotation(org.apache.xerces.xs.XSAnnotation annotationObject)

getGlobalTypes

public static java.util.Vector getGlobalTypes(Type type)
Returns a list of all parents which are global types.

Parameters:
type - starting type to look for global parents

evalGlobalTypes

public static void evalGlobalTypes(Type type,
                                   java.util.Vector resultTypes,
                                   java.util.Vector resultXPaths)

evalGlobalTypes

public static void evalGlobalTypes(Type type,
                                   java.util.Vector resultTypes,
                                   java.util.Map globalTypes,
                                   java.util.Stack buff,
                                   java.util.Vector resultXPaths)
Returns a list of all parents which are global types.

Parameters:
type - starting type to look for global parents

evalGlobalTypesGlobalRefBased

public static void evalGlobalTypesGlobalRefBased(Type type,
                                                 java.util.Vector resultTypes,
                                                 java.util.Map globalTypes,
                                                 java.util.Stack buff,
                                                 java.util.Vector resultXPaths)

evalGlobalTypesRefBased

public static void evalGlobalTypesRefBased(SchemaNode schemaNode,
                                           java.util.Vector resultTypes,
                                           java.util.Map globalTypes,
                                           java.util.Stack buff,
                                           java.util.Vector resultXPaths)

evalGlobalTypesElementBased

public static void evalGlobalTypesElementBased(Type type,
                                               java.util.Vector resultTypes,
                                               java.util.Map globalTypes,
                                               java.util.Stack buff,
                                               java.util.Vector resultXPaths)

countSubNodes

public static int countSubNodes(SchemaNode node)

countSubNodes

public static int countSubNodes(SchemaNode node,
                                java.util.Hashtable recursionHash)

countSubNodes

public static int countSubNodes(Type type)

countEditingTypeSubNodes

public static int countEditingTypeSubNodes(Type type)

countNodeDepth

public static int countNodeDepth(Type type)

getGlobalParentXPathsUpTo

public static java.lang.String[] getGlobalParentXPathsUpTo(Type type)
Returns an array of all global parent xpaths based on a passing type.

Parameters:
type - starting type to lookup all global parent xpaths

getAbsoluteXPath

public static java.lang.String getAbsoluteXPath(Type type)

merge

public static void merge(XMLSchema schema,
                         org.w3c.dom.Node originalParentNode,
                         org.w3c.dom.Node nodeToMerge)

createDocument

public static org.w3c.dom.Document createDocument(java.io.Reader reader)
                                           throws org.apache.xerces.xni.parser.XMLParseException,
                                                  org.xml.sax.SAXException,
                                                  java.io.IOException
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException

getConditionalXPathHolder

public static java.lang.String getConditionalXPathHolder(java.lang.String xpath)

getDerivedType

public static Type getDerivedType(Type abstractType,
                                  java.lang.String name,
                                  boolean makeCopy)

getLockedTypes

public static java.util.List getLockedTypes(Type rootType,
                                            java.lang.String xpath)

getXMLDBMappingDOM

public static Document getXMLDBMappingDOM(java.lang.String context,
                                          java.net.URL xsdURL,
                                          java.net.URL xuiURL)

updateJAXFormsDOM

public static Document updateJAXFormsDOM(Document jaxformsDOM,
                                         Document targetDOM,
                                         org.w3c.dom.Document xmlDataDOM,
                                         Document xuiDOM,
                                         Document pdfXUIDOM,
                                         java.net.URL xsdURL,
                                         java.net.URL xuiURL,
                                         NLS nls,
                                         java.net.URL xmlURL)

getJAXFormsDOM

public static Document getJAXFormsDOM(java.lang.String context,
                                      java.util.Hashtable metaInfo)

getNameSpaces

public static java.util.Hashtable getNameSpaces(org.w3c.dom.Document dom)

getNameSpaceToPrefixMapping

public static java.util.Hashtable getNameSpaceToPrefixMapping(org.w3c.dom.Document dom)

getAdditionalXUIHeaderAttribs

public static java.lang.String getAdditionalXUIHeaderAttribs(Document dom)

getAdditionalXMLHeaderAttribs

public static java.lang.String getAdditionalXMLHeaderAttribs(Document dom)

getXMLHeaderAttribs

public static java.lang.String getXMLHeaderAttribs(Document dom,
                                                   java.util.Map attribs)

getXMLHeaderAttributes

public static java.util.Hashtable getXMLHeaderAttributes(org.w3c.dom.Document dom)

getDefaultNameSpace

public static java.lang.String getDefaultNameSpace(org.w3c.dom.Document dom)

getAllIncludedURLs

public static void getAllIncludedURLs(java.net.URL xsdURL,
                                      java.util.List includeList,
                                      boolean onlyValue,
                                      boolean rootIncluded)

getAllSchemaBaseAttributes

public static java.util.Hashtable getAllSchemaBaseAttributes(org.w3c.dom.Document dom)

getAllSchemaBaseAttributes

public static java.util.Hashtable getAllSchemaBaseAttributes(java.lang.String xsdString)

getAllSchemaBaseAttributes

public static java.util.Hashtable getAllSchemaBaseAttributes(java.net.URL xsdURL)

getPrefixForNamespace

public static java.lang.String getPrefixForNamespace(org.w3c.dom.Document doc,
                                                     java.lang.String nameSpace)

mergeSchemaWithIncludedSchemas

public static void mergeSchemaWithIncludedSchemas(java.net.URL xsdURL,
                                                  org.w3c.dom.Document baseDoc,
                                                  boolean isRoot,
                                                  java.lang.String startXSDPrefix)

extractData

public static java.util.Hashtable extractData(org.w3c.dom.Document dom,
                                              java.lang.String tagName)
                                       throws javax.xml.transform.TransformerException
Throws:
javax.xml.transform.TransformerException

getNamespaceDeclarations

public static java.util.Vector getNamespaceDeclarations(java.util.Hashtable nameSpaces,
                                                        boolean isXuiDom,
                                                        boolean forceSerialization,
                                                        java.lang.String defaultNameSpace)

performLateBind

public static void performLateBind(Type targetType,
                                   org.w3c.dom.Element dataSource)

resetListViews

public static void resetListViews(Type type)

getAllChilds

public static java.util.List getAllChilds(Type aStartType,
                                          boolean includingStartType)

getAllChilds

public static void getAllChilds(Type aStartType,
                                java.lang.String name,
                                java.lang.String ns,
                                java.util.List result)

getAllVisStructureChilds

public static java.util.List getAllVisStructureChilds(Type aStartType,
                                                      boolean includingStartType)

getAllChilds

public static java.util.List getAllChilds(Type aStartType)

getAllListChilds

public static java.util.List getAllListChilds(Type aStartType,
                                              boolean onlyDirect)

extractSchemaLocation

public static java.lang.String extractSchemaLocation(java.net.URL loadedFrom,
                                                     java.lang.String schemaLocation,
                                                     java.lang.String targetNS)

vizualizerSelectorTypePathForFocus

public static java.util.List vizualizerSelectorTypePathForFocus(Type startElement)

getChildren

public static java.util.List getChildren(XMLSchema schema,
                                         org.w3c.dom.Element element)
Returns a list of child elements.

Parameters:
element - start element

getEditingTypeParentPath

public static java.util.List getEditingTypeParentPath(Type start)

createBranchFromEditingTypes

public static Type createBranchFromEditingTypes(java.util.List edTypes)

containsValue

public static boolean containsValue(ListType list,
                                    java.lang.String value)

getSchemaXPath

public static java.lang.String getSchemaXPath(SchemaNode sNode)

walkTypeXpath

public static Type walkTypeXpath(java.lang.String xpath,
                                 Type start)

walkTypeXpath

public static Type walkTypeXpath(java.lang.String xpath,
                                 Type start,
                                 boolean edTypeTraverseOnly)

isMandatoryWithinAnonymousGroup

public static boolean isMandatoryWithinAnonymousGroup(Type type,
                                                      boolean checkGroupIndex)

getAnnotation

public static java.lang.String getAnnotation(Type type)

getEnumerationAnnotation

public static java.lang.String getEnumerationAnnotation(Type type,
                                                        java.lang.String enumName)