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.


Field Summary
static java.lang.String DOCUMENTATION_START
           
static java.lang.String XMLNS
           
static java.lang.String XPATH_FORM_META_OWNER
           
 
Method Summary
static boolean containsChild(Type aStartType, boolean includingStartType, java.lang.String[] names)
           
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, boolean inclEditingType, boolean notEmpty, boolean onlySimple, boolean onlyUserChanged)
           
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(java.io.InputStream is, java.lang.String enc)
          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)
           
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 org.w3c.dom.Document createDocument(java.net.URL url, java.lang.String enc)
           
static org.w3c.dom.Document createEmptyDocument()
          Creates a W3C DOM out of a simple String.
static Type 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 java.util.List elementsToList(java.util.List propElements, java.lang.String field)
           
static java.util.Map elementsToMap(java.util.List propElements, java.lang.String keyField, java.lang.String valueField)
           
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.lang.String evalNamespace(Type type)
           
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.lang.String loadedFrom, java.lang.String schemaLocation, java.lang.String targetNS)
           
static java.lang.String extractSchemaLocation(java.net.URL loadedFrom, java.lang.String schemaLocation, java.lang.String targetNS)
           
static void forceSerialization(java.util.List types, boolean serialize)
           
static void forceSerializationWholeTree(Type root, boolean inclRoot, boolean serialize)
           
static java.lang.String formatPI(org.w3c.dom.Node node)
           
static int[] generateHierachyId(Type type)
           
static short[] generateListPositionIdx(Type type)
           
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 getAllChildren(org.w3c.dom.Element element, java.lang.String name)
           
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 getAllSelectedVisStructureChilds(Type aStartType, boolean choosenOnly)
           
static java.util.List getAllVisStructureChilds(Type aStartType, boolean includingStartType)
           
static java.lang.String getAnnotation(Type type)
           
static java.lang.String getAttributeValue(org.w3c.dom.Node aType, java.lang.String name)
           
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)
           
 java.lang.String[] getDisplayValues(ListType aList)
           
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 getEmailValue(Document dom)
           
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. e.q. global:USAddress/name will return just '.
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
static java.lang.String[] getGlobalParentXPathsUpTo(Type type)
          Returns an array of all global parent xpaths based on a passing type.
static java.util.Vector getGlobalTypes(Type type)
          Returns a list of all parents which are global types.
static int[] getIntValues(ListType list)
           
static Document getJAXFormsDOM(java.lang.String context, java.util.Hashtable metaInfo)
           
static org.w3c.dom.Element getLastChild(XMLSchema schema, org.w3c.dom.Element element, java.lang.String[] name, int index)
           
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 int getNodeDepth(Type type)
           
static int getNodePos(org.w3c.dom.NodeList nl, org.w3c.dom.Node startNode)
           
static java.lang.String getNoNameSpaceSchemaLocation(org.w3c.dom.Document dom)
           
static java.util.List getParents(Type start)
           
static java.util.List<Type> getPDFPrintTree(Type type)
           
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 java.util.List<org.w3c.dom.ProcessingInstruction> getProcessingInstructions(org.w3c.dom.NodeList levelNodes, org.w3c.dom.Node startNode, java.lang.String target, int pos)
           
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 getProcessingInstructionValue(org.w3c.dom.ProcessingInstruction pi, java.lang.String name)
           
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 Type getRoot(Type aType)
          Returns the root node for the passing node.
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 Type getTypeChild(Type aType, java.lang.String name)
           
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 getValue(Type aType)
           
static java.lang.String getValueFromW3CDOM(org.w3c.dom.Document dom, java.lang.String xpath)
           
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 java.lang.String mergeDBM(JAXFrontLSInput dbmInput)
           
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 java.lang.String prettyPrint(org.w3c.dom.Document doc, int lineWidth, boolean indenting, int indent)
           
static void prettyPrint(org.w3c.dom.Document doc, java.io.OutputStream out)
           
static void prettyPrint(org.w3c.dom.Document doc, java.io.OutputStream out, int lineWidth, boolean indenting, int indent)
           
static java.lang.String prettyPrint(java.lang.String xml, int lineWidth, boolean indenting, int indent)
           
static void resetListViews(Type type)
           
static org.w3c.dom.ProcessingInstruction searchPrevProcessingInstruction(org.w3c.dom.Node startNode, java.lang.String target)
           
static java.util.List<org.w3c.dom.ProcessingInstruction> searchPrevProcessingInstructions(org.w3c.dom.Node startNode, java.lang.String target)
           
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 boolean setTypeValues(Document dom, java.lang.String xpath, java.lang.String value)
           
static java.util.Hashtable toHashtable(ListType list, java.lang.String keyName, java.lang.String valName)
           
static java.lang.String toString(ListType aMappingTargetType, java.lang.String delim)
           
static java.lang.String[] toStringArray(java.util.List simpleTypes)
           
static java.util.List toValueList(java.util.List simpleTypes)
           
static java.util.List toValueList(java.util.List simpleTypes, java.lang.String[] names)
           
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.lang.String[] valueToArray(java.util.List listOfSimpleTypes)
           
static java.lang.String[] valueToArray(java.util.List listOfSimpleTypes, java.lang.String[] names)
           
static java.util.List valueToList(java.util.List listOfSimpleTypes)
           
static java.util.List valueToList(java.util.List listOfSimpleTypes, java.lang.String[] names)
           
static java.util.List vizualizerSelectorTypePathForFocus(Type startElement)
           
static Type walkNormalizedXpathUp(java.lang.String xpath, Type start)
           
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

DOCUMENTATION_START

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

XMLNS

public static final java.lang.String XMLNS

XPATH_FORM_META_OWNER

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

containsChild

public static boolean containsChild(Type aStartType,
                                    boolean includingStartType,
                                    java.lang.String[] names)

containsValue

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

countEditingTypeSubNodes

public static int countEditingTypeSubNodes(Type type)

countNodeDepth

public static int countNodeDepth(Type type)

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,
                                boolean inclEditingType,
                                boolean notEmpty,
                                boolean onlySimple,
                                boolean onlyUserChanged)

createBranchFromEditingTypes

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

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

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

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(java.io.InputStream is,
                                                  java.lang.String enc)
                                           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(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

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
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

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.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.net.URL url,
                                                  java.lang.String enc)
                                           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

createEmptyDocument

public static org.w3c.dom.Document createEmptyDocument()
                                                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

createFromEditingTypeXPath

public static Type createFromEditingTypeXPath(Type start,
                                              java.lang.String xpath)
                                       throws XPathError
Throws:
XPathError

createInfoListXPath

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

createInfoXPath

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

createInfoXPath

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

elementsToList

public static java.util.List elementsToList(java.util.List propElements,
                                            java.lang.String field)

elementsToMap

public static java.util.Map elementsToMap(java.util.List propElements,
                                          java.lang.String keyField,
                                          java.lang.String valueField)

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)

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

evalGlobalTypes

public static void evalGlobalTypes(Type type,
                                   java.util.Vector resultTypes,
                                   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)

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)

evalNamespace

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

extractAnnotation

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

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

extractSchemaLocation

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

extractSchemaLocation

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

forceSerialization

public static void forceSerialization(java.util.List types,
                                      boolean serialize)

forceSerializationWholeTree

public static void forceSerializationWholeTree(Type root,
                                               boolean inclRoot,
                                               boolean serialize)

formatPI

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

generateHierachyId

public static int[] generateHierachyId(Type type)

generateListPositionIdx

public static short[] generateListPositionIdx(Type type)

getAbsoluteXPath

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

getAdditionalXMLHeaderAttribs

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

getAdditionalXUIHeaderAttribs

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

getAllChildren

public static java.util.List getAllChildren(org.w3c.dom.Element element,
                                            java.lang.String name)

getAllChilds

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

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)

getAllIncludedURLs

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

getAllListChilds

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

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)

getAllSelectedVisStructureChilds

public static java.util.List getAllSelectedVisStructureChilds(Type aStartType,
                                                              boolean choosenOnly)

getAllVisStructureChilds

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

getAnnotation

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

getAttributeValue

public static java.lang.String getAttributeValue(org.w3c.dom.Node aType,
                                                 java.lang.String name)

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)
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,
                                           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

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

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

getChild

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

getChildren

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

Parameters:
element - start element

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

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,
                                         Type aType)
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

getComplexParent

public static Type getComplexParent(Type aChildType)

getConditionalXPathHolder

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

getDefaultNameSpace

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

getDerivedType

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

getDisplayValues

public java.lang.String[] getDisplayValues(ListType aList)

getDocElementValue

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

getEditingTypeParentPath

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

getEmailValue

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

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

getEnumerationAnnotation

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

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

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

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

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

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

getIntValues

public static int[] getIntValues(ListType list)

getJAXFormsDOM

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

getLastChild

public static org.w3c.dom.Element getLastChild(XMLSchema schema,
                                               org.w3c.dom.Element element,
                                               java.lang.String[] name,
                                               int index)

getLockedTypes

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

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

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

getNamespaceDeclarations

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

getNameSpaces

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

getNameSpaceSchemaLocation

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

getNameSpaceToPrefixMapping

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

getNodeDepth

public static int getNodeDepth(Type type)

getNodePos

public static int getNodePos(org.w3c.dom.NodeList nl,
                             org.w3c.dom.Node startNode)

getNoNameSpaceSchemaLocation

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

getParents

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

getPDFPrintTree

public static java.util.List<Type> getPDFPrintTree(Type type)

getPlainXPath

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

getPlainXPath

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

getPrefixForNamespace

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

getProcessingInstruction

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

getProcessingInstructions

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

getProcessingInstructions

public static java.util.List<org.w3c.dom.ProcessingInstruction> getProcessingInstructions(org.w3c.dom.NodeList levelNodes,
                                                                                          org.w3c.dom.Node startNode,
                                                                                          java.lang.String target,
                                                                                          int pos)

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.

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.

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.

getProcessingInstructionValue

public static java.lang.String getProcessingInstructionValue(org.w3c.dom.ProcessingInstruction pi,
                                                             java.lang.String name)

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)

getRecursiveParent

public static Type getRecursiveParent(Type aType,
                                      boolean startWithCurrent)

getRelativeEditingTypeXPath

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

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

getRoot

public static Type getRoot(Type aType)
Returns the root node for the passing node.

Parameters:
parent - to lookup
parentName - name of the parent

getSchemaXPath

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

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

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

getTypeChild

public static Type getTypeChild(Type aType,
                                java.lang.String name)

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)

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)

getValue

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

getValueFromW3CDOM

public static java.lang.String getValueFromW3CDOM(org.w3c.dom.Document dom,
                                                  java.lang.String xpath)

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

getValues

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

getXMLDBMappingDOM

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

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)

getXMLProcessingInstructionValue

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

getXPathForRecursion

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

hasAnonymousChildren

public static boolean hasAnonymousChildren(Type aType)

hasRecursiveParent

public static boolean hasRecursiveParent(Type aType)

isJAXFrontXSDSchema

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

isMandatoryWithinAnonymousGroup

public static boolean isMandatoryWithinAnonymousGroup(Type type,
                                                      boolean checkGroupIndex)

merge

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

mergeDBM

public static java.lang.String mergeDBM(JAXFrontLSInput dbmInput)
                                 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

mergeSchemaWithIncludedSchemas

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

performLateBind

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

prettyPrint

public static java.lang.String prettyPrint(org.w3c.dom.Document doc,
                                           int lineWidth,
                                           boolean indenting,
                                           int indent)

prettyPrint

public static void prettyPrint(org.w3c.dom.Document doc,
                               java.io.OutputStream out)
                        throws java.lang.Exception
Throws:
java.lang.Exception

prettyPrint

public static void prettyPrint(org.w3c.dom.Document doc,
                               java.io.OutputStream out,
                               int lineWidth,
                               boolean indenting,
                               int indent)
                        throws java.lang.Exception
Throws:
java.lang.Exception

prettyPrint

public static java.lang.String prettyPrint(java.lang.String xml,
                                           int lineWidth,
                                           boolean indenting,
                                           int indent)

resetListViews

public static void resetListViews(Type type)

searchPrevProcessingInstruction

public static org.w3c.dom.ProcessingInstruction searchPrevProcessingInstruction(org.w3c.dom.Node startNode,
                                                                                java.lang.String target)

searchPrevProcessingInstructions

public static java.util.List<org.w3c.dom.ProcessingInstruction> searchPrevProcessingInstructions(org.w3c.dom.Node startNode,
                                                                                                 java.lang.String target)

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

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

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

setTypeValues

public static boolean setTypeValues(Document dom,
                                    java.lang.String xpath,
                                    java.lang.String value)

toHashtable

public static java.util.Hashtable toHashtable(ListType list,
                                              java.lang.String keyName,
                                              java.lang.String valName)

toString

public static java.lang.String toString(ListType aMappingTargetType,
                                        java.lang.String delim)

toStringArray

public static java.lang.String[] toStringArray(java.util.List simpleTypes)

toValueList

public static java.util.List toValueList(java.util.List simpleTypes)

toValueList

public static java.util.List toValueList(java.util.List simpleTypes,
                                         java.lang.String[] names)

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)

valueToArray

public static java.lang.String[] valueToArray(java.util.List listOfSimpleTypes)

valueToArray

public static java.lang.String[] valueToArray(java.util.List listOfSimpleTypes,
                                              java.lang.String[] names)
Parameters:
excluded -
Returns:

valueToList

public static java.util.List valueToList(java.util.List listOfSimpleTypes)
Parameters:
excluded -
Returns:

valueToList

public static java.util.List valueToList(java.util.List listOfSimpleTypes,
                                         java.lang.String[] names)

vizualizerSelectorTypePathForFocus

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

walkNormalizedXpathUp

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

walkTypeXpath

public static Type walkTypeXpath(java.lang.String xpath,
                                 Type start)
                          throws XPathError
Throws:
XPathError

walkTypeXpath

public static Type walkTypeXpath(java.lang.String xpath,
                                 Type start,
                                 boolean edTypeTraverseOnly)
                          throws XPathError
Throws:
XPathError

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

write

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