public class KElement extends org.apache.xerces.dom.ElementNSImpl implements Element
for the first element class that is aware of JDF
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
KElement.SimpleElementNameComparator
sorts according to the lexical string representation of the xml objects
|
static class |
KElement.SimpleNodeComparator
sorts according to the lexical string representation of the xml objects
|
static class |
KElement.SingleAttributeComparator
sorts according to the value of one attribute
if the attribute is numeric, compare numerically, else lexical comparison is done |
static class |
KElement.SingleXPathComparator
sorts according to the value of one attribute
if the attribute is numeric, compare numerically, else lexical comparison is done |
firstChild, fNodeListCache, ownerDocument
DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_IS_CONTAINED, DOCUMENT_POSITION_PRECEDING, ELEMENT_DEFINITION_NODE, FIRSTCHILD, flags, HASSTRING, ID, IGNORABLEWS, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED, SYNCCHILDREN, SYNCDATA, TREE_POSITION_ANCESTOR, TREE_POSITION_DESCENDANT, TREE_POSITION_DISCONNECTED, TREE_POSITION_EQUIVALENT, TREE_POSITION_FOLLOWING, TREE_POSITION_PRECEDING, TREE_POSITION_SAME_NODE
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
DERIVATION_EXTENSION, DERIVATION_LIST, DERIVATION_RESTRICTION, DERIVATION_UNION
Constructor and Description |
---|
KElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
String qualifiedName)
Constructor for KElement
|
KElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
String myNamespaceURI,
String qualifiedName)
Constructor for KElement
|
KElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument,
String myNamespaceURI,
String qualifiedName,
String myLocalName)
Constructor for KElement
|
Modifier and Type | Method and Description |
---|---|
double |
addAttribute(String key,
double inc,
String nameSpaceURI)
increments or decrements a numeric attribute by inc
|
int |
addAttribute(String key,
int inc,
String nameSpaceURI)
increments or decrements a numeric attribute by inc
|
boolean |
addNameSpace(String strPrefix,
String strNameSpaceURI)
Adds a NameSpace and maps the prefix to a URI.
|
int |
ancestorDistance(KElement child)
distance to ancestor (0=this)
|
String |
appendAnchor(String newID)
create and append a unique id, keep the existing one if it already exists
|
String |
appendAttribute(String key,
String value,
String nameSpaceURI,
String sep,
boolean bUnique)
Append the contents of value to the existing attribute key.
|
void |
appendCData(KElement cDataElem)
Appends XML CData section
<! |
void |
appendCData(String cDataText)
Appends XML CData section
<! |
Node |
appendChild(Node arg0) |
KElement |
appendElement(String elementName)
append a DOM element.
|
KElement |
appendElement(String elementName,
String nameSpaceURI) |
KElement |
appendElementN(String elementName,
int maxAllowed,
String nameSpaceURI)
Appends a new child element to the end of 'this', if it's maximum number of the children with defined name and nameSpace doesn't exceed maxAllowed
default: AppendElementN(elementName, maxAllowed, null)
|
KElement |
appendElementRaw(String elementName,
String nameSpaceURI)
appends an element without any namespace validity checks or initialization Faster but not sa safe...
|
void |
appendEntityReference(String refName)
appends a entity reference to the actual element
|
void |
appendText(String textName)
append some generic text
|
KElement |
appendTextElement(String nodeName,
String text)
append a text element with text included
|
void |
appendXMLComment(String commentText)
Deprecated.
use appendXMLComment(commentText, null);
|
Node |
appendXMLComment(String commentText,
KElement beforeChild)
append a DOM comment
<! |
String |
buildRelativeXPath(KElement relativeTo,
int methCountSiblings)
Gets the XPath full tree representation of 'this'
|
String |
buildXPath()
Deprecated.
use buildXPath(null,true);
|
String |
buildXPath(String relativeTo)
Deprecated.
use buildXPath(relativeTo,true);
|
String |
buildXPath(String relativeTo,
int methCountSiblings)
Gets the XPath full tree representation of 'this'
|
protected void |
clearTargets() |
KElement |
clone()
the clone is the same document
|
KElement |
cloneNewDoc()
same as @see clone but the clone is in a new document
the document gets copies of context sensitive stuff like zip, mime, filename... |
String |
copyAttribute(String attrib,
KElement src)
copy an attribute from src to this - shorthand if no renaming or namespace handling is necessary
default: copyAttribute(attrib, src, null, null, null)
|
String |
copyAttribute(String attrib,
KElement src,
String srcAttrib,
String nameSpaceURI,
String srcNameSpaceURI)
copy an attribute from src to this, if null - remove the attribute
default: copyAttribute(attrib, src, null, null, null)
|
KElement |
copyElement(KElement src,
KElement beforeChild)
Copies src node (including all attributes and subelements) and inserts the copy into 'this' in front of beforeChild, if it exists.
|
void |
copyElements(VElement v,
KElement beforeChild)
append all children in a vector of elements in the order of the vector
|
KElement |
copyInto(KElement src,
boolean bRemove)
copies a node into this, ignoring identical node names i.e. duplicating elements
|
String |
copyXPathValue(String dstXPath,
KElement src,
String srcXPath)
copy attribute values or text from an xpath in src to this
|
static KElement |
createRoot(String nodename,
String namespaceURI)
create a new root document
|
KElement |
deleteNode()
Deletes itself from its parent
|
void |
eraseEmptyAttributes(boolean bRecurse)
remove all empty attributes from this (e.g. att="")
|
int |
eraseEmptyNodes(boolean bTrimWhite)
Erases all empty text nodes in 'this' and its subelements If there any empty text nodes removes them.
|
HashSet<String> |
fillHashSet(String attName,
String attNS)
fills a HashSet with all values of the attribute in all child elements
|
protected boolean |
fitsName_KElement(String nodeName,
String nameSpaceURI) |
boolean |
fitsName(String nodeName,
String nameSpaceURI)
Tests whether the specified nodename and namespace fits the nodename and namespace of 'this'
|
boolean |
flush()
Flush - remove all attributes, elements and text, leaving only a stub tag
|
String |
generateDotID(String key,
String nameSpaceURI)
generate a unique id in the syntax newID=oldID.nn
nn is a unique number, that is generated as the first integer higher than the number of sibling elements with the same name. |
String |
getAttribute_KElement(String strLocalName)
Mother of all attribute getters
Gets an attribute value out of an element |
String |
getAttribute_KElement(String attrib,
String nameSpaceURI,
String def)
Because getAttribute is overwritten in various classes this method can be called directly to get only KElement Attribute.
|
String |
getAttribute(String strLocalName)
Mother of all attribute getters
Gets an attribute value out of an element |
String |
getAttribute(String attrib,
String nameSpaceURI,
String def)
mother of all attribute getters.
|
JDFAttributeMap |
getAttributeMap_KElement()
Get the Attribute Map of the actual element
|
JDFAttributeMap |
getAttributeMap()
Get the Attribute Map of the actual element
|
String |
getAttributeRaw(String qualifiedName)
getAttribute with no pardon for namespaces or anything
|
VString |
getAttributeVector_KElement()
Gets all attribute keys of 'this' as a vector of strings
|
VString |
getAttributeVector()
Gets all attribute keys of 'this' as a vector of strings
|
boolean |
getBoolAttribute(String attrib,
String nameSpaceURI,
boolean def)
get a boolean attribute
default: getBoolAttribute(attrib, null, false)
|
String |
getCData(int i)
Gets of 'this' the text of the i'th XML CData section.
|
VString |
getChildAttributeList(String nodeName,
String attName,
String nameSpaceURI,
String attValue,
boolean bDirect,
boolean bUnique)
Get a vector of all value of the attribute attName in the children of this node
default: getChildAttributeList(nodeName, attName, null, JDFCoreConstants.WILDCARD, true, true)
|
KElement |
getChildByTagName(String s,
String nameSpaceURI,
int index,
JDFAttributeMap mAttrib,
boolean bDirect,
boolean bAnd)
Get a child from the actual element by the tag name.
|
KElement[] |
getChildElementArray()
gets an array of the direct children of the current element
|
VElement |
getChildElementVector_KElement(String nodeName,
String nameSpaceURI,
JDFAttributeMap mAttrib,
boolean bAnd,
int maxSize)
Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements |
VElement |
getChildElementVector(String nodeName,
String nameSpaceURI)
Get all children from the actual element matching the given conditions
convenience for getChildElementVector(nodeName, nameSpaceURI, null, true, 0, true) |
VElement |
getChildElementVector(String nodeName,
String nameSpaceURI,
JDFAttributeMap mAttrib,
boolean bAnd,
int maxSize)
Deprecated.
060302 - use 6 parameter version
|
VElement |
getChildElementVector(String nodeName,
String nameSpaceURI,
JDFAttributeMap mAttrib,
boolean bAnd,
int maxSize,
boolean bResolveTarget)
Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements |
KElement |
getChildFromList(VString nodeNames,
int iSkip)
Deprecated.
use getChildFromList(Vector nodeNames, int iSkip, JDFAttributeMap map)
|
KElement |
getChildFromList(VString nodeNames,
int iSkip,
JDFAttributeMap map,
boolean bDirect)
Get any Child that matches a string defined in nodeNames.
|
protected Node |
getChildNode(int nodeType,
int iPos)
gets the n'th child node of nodetype
nodeType with n = iPos |
VElement |
getChildNodes_KElement()
Deprecated.
use getChildElementVector(null, null, null, true, 0)
|
Vector |
getChildNodeVector(int maxSize)
Deprecated.
|
<a extends KElement> |
getChildrenByClass(Class<a> clazz,
boolean bRecurse,
int nMax)
Get all children from the actual element matching the given conditions
does NOT get refElement targets although the attributes are checked in the target elements in case of refElements |
VElement |
getChildrenByTagName_KElement(String elementName,
String nameSpaceURI,
JDFAttributeMap mAttrib,
boolean bDirect,
boolean bAnd,
int maxSize)
Gets children of 'this' by tag name, nameSpaceURI and attribute map, if the attribute map is not empty.
|
VElement |
getChildrenByTagName(String elementName,
String nameSpaceURI,
JDFAttributeMap mAttrib,
boolean bDirect,
boolean bAnd,
int maxSize)
Gets children of 'this' by tag name, nameSpaceURI and attribute map, if the attribute map is not empty.
|
VElement |
getChildrenFromList(VString nodeNames,
JDFAttributeMap map,
boolean bDirect,
VElement v)
get a vector of all Children that match the strings defined in nodeNames
|
VElement |
getChildrenIgnoreList(VString nodeNames,
boolean bDirect,
VElement v)
get a vector of all Children that do not match the strings defined in nodeNames
|
VElement |
getChildrenWithAttribute(String nodeName,
String attName,
String nameSpaceURI,
String attVal,
boolean bDirect)
Deprecated.
use getChildrenByTagName(nodeName, nameSpaceURI, new JDFAttributeMap(attName, attVal), bDirect, true, 0);
|
KElement |
getChildWithAttribute(String nodeName,
String attName,
String nameSpaceURI,
String attVal,
int index,
boolean bDirect)
GetChildWithAttribute - Get a child with matching attributes
default: getChildWithAttribute(nodeName, attName, null,attValue, 0, true)
|
KElement |
getCreateChildWithAttribute(String nodeName,
String attName,
String nameSpaceURI,
String attVal,
int index)
GetChildWithAttribute - Get a child with matching attributes; craete it if it does not exist
default: getChildWithAttribute(nodeName, attName, null,attValue, 0, true)
|
KElement |
getCreateElement_KElement(String nodeName,
String nameSpaceURI,
int iSkip)
Gets the iSkip-th child node with matching nodeName and nameSpaceURI, optionally creates it if it doesn't exist.
|
KElement |
getCreateElement(String nodeName)
Get the actual element, create if not there
|
KElement |
getCreateElement(String nodeName,
String nameSpaceURI,
int iSkip)
Get the actual element, create if not there
|
KElement |
getCreateXPathElement(String path)
gets an element as defined by XPath to value and creates it if it does not exist
|
KElement |
getDeepElement(String nodeName,
String nameSpaceURI,
int iSkip)
Deprecated.
use getChildByTagName(nodeName, nameSpaceURI, iSkip, null, false, true);
|
KElement |
getDeepParent(String parentNode,
int depth)
Get the n'th Ancestor node with name parentNode
|
KElement |
getDeepParent(Vector vParentElement,
int depth)
Deprecated.
- loop over the single node method
|
KElement |
getDeepParentChild(String parentNode)
Get the first child of parentNode with name parentNode
|
KElement |
getDeepParentNotName(String thisNode)
Get the Ancestor node with name other than thisNode
|
KElement |
getDocRoot()
Gets the root element of the current document
|
Attr |
getDOMAttr(String attrib,
String nameSpaceURI,
boolean bInherit)
Get The DOM Attribute node of a given attribute if attrib has no namespace prefix and nameSpaceURI is a wildcard the attribute with the element prefix
will be returned if no empty attribute exists e.g. getDOMAttr("a") will return the node x:a in
|
KElement |
getElement_KElement(String nodeName,
String nameSpaceURI,
int iSkip)
getElement - Get the actual element
|
KElement |
getElement(String nodeName)
Get the actual element - utility routine.
|
KElement |
getElement(String nodeName,
String nameSpaceURI,
int iSkip)
Gets an existing iSkip-th child node with matching nodeName and nameSpaceURI
|
<a extends KElement> |
getElementByClass(Class<a> clazz,
int iSkip,
boolean bRecurse)
getElement - Get the actual element by java class
|
HashMap<String,KElement> |
getElementHashMap(String elementName,
String elementNS,
String attName)
performance enhanced function to access multiple elements e.g. by ID get a HashMap of key= attribute value, object=element
|
VString |
getElementNameVector()
Returns a vector which contains the childs of the actual element.
|
VElement |
getElementsByTagName_KElement(String s,
String nameSpaceURI)
wrappers of DOM routines that dont bang on null nodes
|
KElement |
getFirstChildElement()
get the first child element
|
<a extends KElement> |
getFirstChildElement(Class<a> clazz)
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.
|
KElement |
getFirstChildElement(String nodeName,
String nameSpaceURI)
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.
|
static Element |
getFirstElementNode(Element parent)
Deprecated.
use elem.getFirstChildElement
|
String |
getID()
gets attribute ID
|
protected String |
getIDPrefix()
getIDPrefix
|
String |
getInheritedAttribute(String attrib,
String nameSpaceURI,
String def)
searches for the first attribute occurence in this element or any ancestors
|
KElement |
getInheritedElement(String elementName,
String nameSpaceURI,
int iSkip)
searches for the first child element occurence in this element or any ancestors
default: getInheritedElement(elementName, null, 0)
|
String |
getInheritedXPathAttribute(String path,
String def)
Gets an attribute value as defined by XPath namespace prefixes are resolved
Attributes are searched for in partitioned resources if appropriate |
int |
getIntAttribute(String attrib,
String nameSpaceURI,
int def)
Get a integer attribute if present
default: getIntAttribute(attrib, null, 0)
|
static String |
getLocalNameStatic(KElement kElem)
Deprecated.
use getLocalName
|
long |
getLongAttribute(String attrib,
String nameSpaceURI,
long def)
Get a long attribute if present
default: getLongAttribute(attrib, null, 0)
|
VString |
getMultipleIDs(String JDFCoreConstants)
Get a vector of all IDs that occur multiple times
|
String |
getNamespaceURI()
Get the NameSpaceURI
|
String |
getNamespaceURIFromPrefix(String prefix)
Gets the NameSpaceURI corresponding to a given prefix, returns null if no namespace is defined
|
static Element |
getNextElementNode(Element elem)
Deprecated.
- use elem.getNextSiblingElement();
|
KElement |
getNextSiblingElement()
get the next sibling element
|
<a extends KElement> |
getNextSiblingElement(Class<a> clazz)
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.
|
KElement |
getNextSiblingElement(String nodeName,
String nameSpaceURI)
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.
|
String |
getNonEmpty_KElement(String strLocalName)
similar to getAttribute but returns null for all empty strings
Gets an attribute value out of an element
|
String |
getNonEmpty(String strLocalName)
similar to getAttribute but returns null for all empty strings
Gets an attribute value out of an element
|
int |
getNumCDatas()
gets the number of direct child CData sections
|
int |
getNumChildNodes(int nodeType)
Gets the number of direct child nodes of 'this', that match NodeType
|
int |
getNumChildText()
Gets the number of direct text child nodes
|
int |
getNumXMLComments()
gets the number of direct XMLComment child nodes of 'this'
|
XMLDoc |
getOwnerDocument_KElement()
Get the document object that owns this
|
KElement |
getParentNode_KElement()
get the parent node of this
|
KElement |
getPreviousSiblingElement()
get the previous sibling element
|
KElement |
getPreviousSiblingElement(String nodeName,
String nameSpaceURI)
Gets the previous sibling named nodename from the namespace nameSpaceURI of 'this'.
|
double |
getRealAttribute(String attrib,
String nameSpaceURI,
double def)
get a double attribute
default: getRealAttribute(attrib, null, 0.0)
|
KElement |
getTarget_KElement(String id,
String attrib)
Gets the target of link.
|
KElement |
getTarget(String id,
String attrib)
looking for a specified target with an id, e.g. resource.
|
String |
getText()
gets a concatenated string representing of all direct text child nodes
|
String |
getText(int i)
gets the i'th text child node of 'this'
|
VElement |
getTree(String nodeName,
String nameSpaceURI,
JDFAttributeMap mAttrib,
boolean bDirect,
boolean bAnd)
Get children from the actual element by the tag name, nameSpaceURI or attribute map.
|
KElement |
getTreeElement(String nodeName,
String nameSpaceURI,
JDFAttributeMap mAttrib,
boolean bDirect,
boolean bAnd)
Get child from the actual element by the tag name, nameSpaceURI or attribute map.
|
String |
getXMLComment(int i)
gets of 'this' the text of the i-th child XMLComment.
|
static String |
getXMLNSNameSpace(String pc)
Deprecated.
|
static String |
getXMLNSPrefix(String pc)
Deprecated.
use xmlnsPrefix
|
String |
getXPathAttribute(String path,
String def)
Gets an attribute value as defined by XPath namespace prefixes are resolved or the node text if an element is specified
|
JDFAttributeMap |
getXPathAttributeMap(String path)
Gets a map of attribute values as defined by XPath namespace prefixes are resolved
|
KElement |
getXPathElement(String path)
gets an element as defined by XPath to value
|
VElement |
getXPathElementVector(String path,
int maxSize)
gets an vector of elements element as defined by XPath to value
|
JDFAttributeMap |
getXPathValueMap()
Gets a map of attribute values as defined by XPath namespace prefixes are resolved
|
String |
getXSIType()
returns the xsi:type of this element, null if not present
|
boolean |
hasAttribute_KElement(String attrib,
String nameSpaceURI,
boolean bInherit)
Checks if the actual element has a specific attribute
this version checks within the exact xml element |
boolean |
hasAttribute(String attrib)
Checks if the actual element has a specific attribute
this version checks only the explicit element and NOT any inherited resource partiotions Attention! |
boolean |
hasAttribute(String attrib,
String nameSpaceURI,
boolean bInherit)
Checks if the actual element has a specific attribute
this version checks within the exact xml element |
boolean |
hasAttributes()
checks if the current element has attributes
|
boolean |
hasChildElement(String nodeName,
String nameSpaceURI)
Checks whether the current element has a child element NodeName
default: hasChildElement(String nodeName, null)
|
boolean |
hasChildElements()
checks if the current element has a child element
|
protected boolean |
hasChildNodes(int nodeType)
checks wether this has node childs of the stated node type
|
boolean |
hasChildText()
Tests, whether 'this' contains any text child nodes
|
boolean |
hasNonEmpty_KElement(String strLocalName)
similar to hasAttribute but returns false for all empty strings
Gets an attribute value out of an element
|
boolean |
hasNonEmpty(String strLocalName)
similar to hasAttribute but returns false for all empty strings
Gets an attribute value out of an element
|
boolean |
hasXPathNode(String path)
returns true if the element or attribute described by this XPath exists, else false
|
boolean |
includesAttribute(String attName,
String attValue)
Check if an attribute is present.
|
boolean |
includesAttributes(JDFAttributeMap aMap,
boolean bAnd)
Checks if the actual element contains the attributes given in aMap
|
boolean |
init()
Method init.
|
KElement |
insertAt(String nodeName,
int beforePos,
String beforeNode,
String nameSpaceURI,
String beforeNameSpaceURI)
Creates a new child element with defined Name and NameSpace and inserts it in front of the node with a name bForeNode and namespace beforeNameSpaceURI,
with index beforePos
default: InsertAt(nodeName, beforePos, null, null, null)
|
Node |
insertBefore(Node arg0,
Node arg1) |
KElement |
insertBefore(String elementName,
Node beforeChild,
String nameSpaceURI)
Inserts the Element elementName before the existing Element node beforeChild.
|
boolean |
isAncestor(KElement child)
checks if KElement child is ancestor or not
|
boolean |
isDirty()
Get the dirty status of this element
|
boolean |
isEqual(KElement kElem)
Checks if the contents of this element are equal to element kElem
differs from @see equals because nodes that are in different locations or documents but have the same name, attributes and elements are considered equal |
static boolean |
isWildCard(String nodeName)
Tests whether an argument is a wildcard i.e null, empty or * note that Wildcard ("*") is deprecated ideally null should be used to denote a wildcard
|
boolean |
matchesPath(String path)
Deprecated.
use matchesPath(String path, boolean bFollowRefs)
|
boolean |
matchesPath(String path,
boolean bFollowRefs)
check whether this element matches a simple xpath
|
protected boolean |
matchesPathName(String pathAt) |
KElement |
mergeElement(KElement kElem,
boolean bDelete)
merge nodes in a way that no duplicate elements are created
attention !! |
void |
moveAttribute(String attrib,
KElement src)
moves an attribute from src to this, the attribute will be removed from src and moved to this.
|
void |
moveAttribute(String attrib,
KElement src,
String srcAttrib,
String nameSpaceURI,
String srcNameSpaceURI)
moves an attribute from src to this, the attribute will be removed from src and moved to this.
|
KElement |
moveElement(KElement src,
KElement beforeChild)
Moves src node (including all attributes and subelements) from its parent node into 'this' and inserts it in front of beforeChild, if it exists.
|
void |
moveElements(VElement v,
KElement beforeChild)
move all children in a vector of elements in the order of the vector
|
KElement |
moveMe(KElement beforeChild)
moves this to a position before another child, fails if either this or beforechild are document roots
|
void |
normalize() |
int |
numChildElements_KElement(String node,
String nameSpaceURI)
Get the number of child elements.
|
int |
numChildElements(String node,
String nameSpaceURI)
Get the number of child elements.
|
int |
numChildNodes(int nodeType)
Deprecated.
use 2-parameter version numChildNodes(nodeType, false);
|
int |
numChildNodes(int nodeType,
boolean bRecurse)
count the number of child nodes of DOM nodeType nodeType (0=count all)
|
int |
numChildrenByClass(Class<?> clazz,
boolean bRecurse)
Get the number of child elements of a certain class
|
int |
numSiblingElements(String elementName,
String nameSpaceURI)
get the number of sibling elements
|
KElement |
pushUp(String newParentName)
Moves 'this' from parent to grandparent or to the closest ancestor with name newParentName
|
void |
removeAllText()
removes all text children of the current node
|
void |
removeAttribute_KElement(String attrib,
String nameSpaceURI)
Remove a attribute from the current element
|
void |
removeAttribute(String attrib) |
void |
removeAttribute(String attrib,
String nameSpaceURI)
Remove an attribute from the current element
|
Attr |
removeAttributeNode(Attr arg0) |
void |
removeAttributeNS(String nameSpaceURI,
String attrib) |
void |
removeAttributes(Collection<String> attribs)
Removes all attributes spezified in attribs.
|
void |
removeCData(int i)
Removes the i'th XML CData section
|
Node |
removeChild(Node arg0) |
KElement |
removeChild(String node,
String nameSpaceURI,
int n)
Removes the n'th child node that matches 'nodeName' and 'nameSpaceURI'
|
boolean |
removeChildNode(int nodeType,
int i)
removes the i'th child node, that match NodeType
|
void |
removeChildren(String nodeName,
String nameSpaceURI)
Deprecated.
use three parameter version removeChildren(nodeName, nameSpaceURI, null);
|
void |
removeChildren(String nodeName,
String nameSpaceURI,
JDFAttributeMap mAttrib)
Removes the children named
nodeName in the namespace nameSpaceURI from the parent element
default: removeChildren(null,null,null) |
void |
removeChildrenByClass(Class<? extends Node> clazz) |
void |
removeChildText(int i)
Removes the i'th text node of 'this'
|
void |
removeExtensions(String nsURI)
remove all elements and attributes of a given namespace
|
int |
removeFromAttribute(String key,
String token,
String nameSpaceURI,
String sep,
int nMax)
Removes the attribute value from its value list
Removes the contents of value from the existing attribute key. |
void |
removeXMLComment(int i)
removes the i'th XMLComment node
|
void |
removeXPathAttribute(String path)
remove an attribute or text that is described by the xpath path quietly returns if the attribute or text does not exist
|
void |
removeXPathElement(String path)
remove an attribute or element that is described by the xpath path quietly returns if the element does not exist
|
void |
renameAttribute(String oldName,
String newName)
Rename an attribute in this namespace
if oldName does not exist, newName is NOT modified default: renameAttribute(oldName, newName, null, null) |
void |
renameAttribute(String oldName,
String newName,
String nameSpaceURI,
String newNameSpaceURI)
Rename an attribute in this namespace
if oldName does not exist, newName is NOT modified default: renameAttribute(oldName, newName, null, null) |
KElement |
renameElement(String newName,
String nameSpaceURI)
Rename the element with the String newName.
|
Node |
replaceChild(Node arg0,
Node arg1) |
KElement |
replaceElement(KElement src)
Replaces 'this' with src.
|
void |
setAttribute(String key,
boolean b,
String nameSpaceURI)
SetAttribute - Sets an element attribute
|
void |
setAttribute(String key,
double value,
String nameSpaceURI)
Sets an element attribute
|
void |
setAttribute(String key,
double value,
String nameSpaceURI,
int precision)
Sets an element attribute
|
void |
setAttribute(String key,
int value,
String nameSpaceURI)
Sets an element attribute
|
void |
setAttribute(String key,
long value,
String nameSpaceURI)
Sets an element attribute
|
void |
setAttribute(String key,
String value)
no namespace variant
|
void |
setAttribute(String key,
String value,
String nameSpaceURI)
Mother of all Attribute setters
Sets a new attribute. |
void |
setAttribute(String key,
VString value,
String nameSpaceURI)
Sets an NMTOKENS attribute to all elements from parameter value will be concatenate with blanks to the resulting NMTOKEN
|
Attr |
setAttributeNode(Attr arg0) |
Attr |
setAttributeNodeNS(Attr arg0) |
void |
setAttributeNS(String nsURI,
String arg1,
String arg2) |
void |
setAttributeNSRaw(String ns,
String key,
String value)
fastest setAttribute with namespace- use only if you know exactly what you are doing
|
void |
setAttributeRaw(String key,
String value)
fastest setAttribute - use only if you know exactly what you are doing
|
int |
setAttributes(JDFAttributeMap map)
Sets the attributes from the curent element.
|
int |
setAttributes(KElement kElem)
Sets the attributes from the curent element to the attributes from kElem.
|
int |
setAttributes(KElement kElem,
VString ignoreList)
Sets the attributes from the curent element to the attributes from kElem.
|
void |
setAttributes(String[] myAttributes,
String[] strValues)
Deprecated.
use setAttributes(JDFAttributeMap)
|
void |
setAttributesRaw(KElement kElem)
Sets the attributes from the current element to the attributes from kElem.
|
void |
setBoolAttribute(String key,
boolean b,
String nameSpaceURI)
Deprecated.
use setAttribute instead
|
void |
setDirty()
Deprecated.
use setDirty (bAttribute)
|
void |
setDirty(boolean bAttribute)
Set this element as dirty
|
void |
setID(String id)
gets attribute ID
|
void |
setIntAttribute(String key,
int value,
String nameSpaceURI)
Deprecated.
use setAttribute instead
|
static void |
setLongID(boolean bLong)
set the ID generation algorithm to include a date
|
void |
setNamespaceURI(String arg0) |
void |
setNodeValue(String arg0) |
void |
setNonEmpty(String key,
String val)
convenience setter
same as setAttribute but never sets ""
|
void |
setPrefix(String arg0) |
void |
setRealAttribute(String key,
double value,
String nameSpaceURI)
Deprecated.
use setAttribute instead
|
void |
setText(String text)
Sets an XML Text
the text contents of this to the value of text |
void |
setvStringAttribute(String key,
VString value,
String nameSpaceURI)
Deprecated.
use setAttribute instead
|
void |
setXMLComment(String commentText)
set a DOM comment
<! |
void |
setXPathAttribute(String path,
String value)
Sets an attribute as defined by XPath to value
|
void |
setXPathValue(String path,
String value)
Sets an attribute as defined by XPath to value
|
void |
setXPathValues(JDFAttributeMap map)
sets all xpaths to the values provided in map
|
void |
setXSIType(String typ) |
void |
sortChild(KElement e)
sorts/inserts e by alphabet
|
void |
sortChild(KElement e,
Comparator<KElement> comparator)
insert e into this, assuming that this is already sorted
|
void |
sortChildren()
sorts all child elements by alphabet
|
void |
sortChildren(boolean bRecursive)
sorts all child elements by alphabet
|
void |
sortChildren(Comparator<KElement> comparator)
sorts all child elements by alphabet
|
void |
sortChildren(Comparator<KElement> comparator,
boolean bRecursive)
sorts all child elements by alphabet
|
String |
toDisplayXML(int indent)
serialize this to a string
|
String |
toString()
this to string, used for debug purpose mostly
|
String |
toXML()
serialize this to a string
|
String |
toXML(int indent)
serialize this to a string
|
static String |
uniqueID(int id)
UniqueID - create a unique id based on date and time + a counter - 6 digits are taken from id Normally this should only be used internally, @see
JDFElement.appendAnchor() for details.
|
boolean |
write2File(File file)
write myself to a file
|
boolean |
write2File(String filename)
write myself to a file
|
boolean |
write2Stream(OutputStream stream)
write myself to an output stream
|
static String |
xmlNameSpace(String s)
Deprecated.
use xmlnsPrefix()
|
static String |
xmlnsLocalName(String pc)
used by get localname
|
static String |
xmlnsPrefix(String nodeName)
Parses pc for it's namespace prefix
|
getBaseURI, getLocalName, getPrefix, getTypeName, getTypeNamespace, isDerivedFrom, setType, setValues
cloneNode, getAttributeNode, getAttributeNodeNS, getAttributeNS, getAttributes, getDefaultAttributes, getElementsByTagName, getElementsByTagNameNS, getNodeName, getNodeType, getSchemaTypeInfo, getTagName, getXercesAttribute, hasAttributeNS, isEqualNode, reconcileDefaultAttributes, setIdAttribute, setIdAttributeNode, setIdAttributeNS, setOwnerDocument, setReadOnly, setupDefaultAttributes, setXercesAttributeNode, synchronizeData
getChildNodes, getChildNodesUnoptimized, getFirstChild, getLastChild, getLength, getOwnerDocument, getTextContent, hasChildNodes, item, setTextContent, synchronizeChildren
getNextSibling, getParentNode, getPreviousSibling
addEventListener, changed, changes, compareDocumentPosition, compareTreePosition, dispatchEvent, getContainer, getFeature, getNodeNumber, getNodeValue, getReadOnly, getUserData, getUserData, getUserDataRecord, isDefaultNamespace, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, needsSyncChildren, removeEventListener, setUserData, setUserData
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, setTextContent, setUserData
public KElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String qualifiedName)
myOwnerDocument
- the owner document of the new elementqualifiedName
- the qualified name of the elementpublic KElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String myNamespaceURI, String qualifiedName)
myOwnerDocument
- the owner document of the new elementmyNamespaceURI
- the namespace of the new elementqualifiedName
- the qualified name of the elementpublic KElement(org.apache.xerces.dom.CoreDocumentImpl myOwnerDocument, String myNamespaceURI, String qualifiedName, String myLocalName)
myOwnerDocument
- the owner document of the new elementmyNamespaceURI
- the namespace of the new elementqualifiedName
- the qualified name of the elementmyLocalName
- the localname of the elementpublic boolean isDirty()
@Deprecated public void setDirty()
public void setDirty(boolean bAttribute)
bAttribute
- if true, only attributes are dirty, else also sub-elementspublic XMLDoc getOwnerDocument_KElement()
public String getInheritedAttribute(String attrib, String nameSpaceURI, String def)
attrib
- the attribute namenameSpaceURI
- the XML-namespacedef
- the default if it does not existpublic String getAttribute(String attrib, String nameSpaceURI, String def)
attrib
- the name of the attribute you want to havenameSpaceURI
- namespace of keydef
- the value that is returned if attrib does not exist in this or this is nullpublic String getAttribute_KElement(String attrib, String nameSpaceURI, String def)
attrib
- the name of the attribute you want to havenameSpaceURI
- namespace of keydef
- the value that is returned if attrib does not exist in this - may be nullpublic String getAttribute(String strLocalName)
getAttribute
in interface Element
getAttribute
in class org.apache.xerces.dom.ElementImpl
strLocalName
- the name of the attribute you want to havepublic String getNonEmpty(String strLocalName)
strLocalName
- the name of the attribute you want to havepublic String getNonEmpty_KElement(String strLocalName)
strLocalName
- the name of the attribute you want to havepublic boolean hasNonEmpty(String strLocalName)
strLocalName
- the name of the attribute you want to havepublic boolean hasNonEmpty_KElement(String strLocalName)
strLocalName
- the name of the attribute you want to havepublic String getAttributeRaw(String qualifiedName)
qualifiedName
- the name of the attribute you want to havepublic String getAttribute_KElement(String strLocalName)
strLocalName
- the name of the attribute you want to havepublic KElement getParentNode_KElement()
@Deprecated public void setvStringAttribute(String key, VString value, String nameSpaceURI)
key
- the name of the attribute to setvalue
- the values for the attribute keynameSpaceURI
- the namespace of the keypublic void setAttribute(String key, VString value, String nameSpaceURI)
key
- the name of the attribute to setvalue
- the values for the attribute keynameSpaceURI
- the namespace of the keypublic Attr getDOMAttr(String attrib, String nameSpaceURI, boolean bInherit)
attrib
- the attribute NamenameSpaceURI
- then namespaceURI, defaults to the local namespacebInherit
- search in parent elements as wellpublic void setAttribute(String key, String value, String nameSpaceURI)
key
- the qualified name of the attribute to create or alter.value
- the value to set in string form. If null, the attribute is removednameSpaceURI
- the namespace the element is inJDFException
- if no settings of its attributes are possiblepublic void setAttribute(String key, String value)
setAttribute
in interface Element
setAttribute
in class org.apache.xerces.dom.ElementImpl
key
- name of the attribute to setvalue
- value of the attributepublic void setAttributeRaw(String key, String value)
key
- name of the attribute to setvalue
- value of the attributepublic void setAttributeNSRaw(String ns, String key, String value)
ns
- the namespace urikey
- name of the attribute to setvalue
- value of the attribute@Deprecated public void setIntAttribute(String key, int value, String nameSpaceURI)
key
- the name of the attribute to setvalue
- the value for the attributenameSpaceURI
- the namespace the element is inpublic void setAttribute(String key, int value, String nameSpaceURI)
key
- the name of the attribute to setvalue
- the value for the attributenameSpaceURI
- the namespace the element is inpublic void setAttribute(String key, long value, String nameSpaceURI)
key
- the name of the attribute to setvalue
- the long value for the attributenameSpaceURI
- the namespace the element is in@Deprecated public void setRealAttribute(String key, double value, String nameSpaceURI)
key
- the name of the attribute to setvalue
- the value for the attributenameSpaceURI
- the namespace the element is inpublic void setAttribute(String key, double value, String nameSpaceURI)
key
- the name of the attribute to setvalue
- the value for the attributenameSpaceURI
- the namespace the element is inpublic void setAttribute(String key, double value, String nameSpaceURI, int precision)
key
- the name of the attribute to setvalue
- the value for the attributenameSpaceURI
- the namespace the element is inprecision
- @Deprecated public void setBoolAttribute(String key, boolean b, String nameSpaceURI)
key
- the name of the attribute to setb
- value of the boolean attribute to be set (true or false)nameSpaceURI
- the nameSpace the attribute is inpublic void setAttribute(String key, boolean b, String nameSpaceURI)
key
- the name of the attribute to setb
- value of the boolean attribute to be set (true or false)nameSpaceURI
- the nameSpace the attribute is inpublic double addAttribute(String key, double inc, String nameSpaceURI)
key
- the name of the attribute to setinc
- the value to increment or decrement bynameSpaceURI
- the nameSpace the attribute is inpublic int addAttribute(String key, int inc, String nameSpaceURI)
key
- the name of the attribute to setinc
- the value to increment or decrement bynameSpaceURI
- the nameSpace the attribute is inpublic void removeAttribute(String attrib, String nameSpaceURI)
attrib
- attribute name to removenameSpaceURI
- the nameSpace of the attributpublic void removeAttribute_KElement(String attrib, String nameSpaceURI)
attrib
- attribute name to removenameSpaceURI
- the nameSpace of the attributpublic boolean hasAttribute(String attrib)
hasAttribute
in interface Element
hasAttribute
in class org.apache.xerces.dom.ElementImpl
attrib
- the name of the attribute to look forpublic boolean hasAttribute(String attrib, String nameSpaceURI, boolean bInherit)
attrib
- the name of the attribute to look fornameSpaceURI
- the nameSpace to look inbInherit
- if true also check recursively in parent elementspublic boolean hasAttribute_KElement(String attrib, String nameSpaceURI, boolean bInherit)
attrib
- the name of the attribute to look fornameSpaceURI
- the nameSpace to look inbInherit
- if true also check recursively in parent elementspublic String appendAttribute(String key, String value, String nameSpaceURI, String sep, boolean bUnique)
key
- attribute keyvalue
- string to be appendednameSpaceURI
- namespace of keysep
- separator between the original attribute value and value, defaults to " " if nullbUnique
- if true, the attribute will only be appended if it is not yet within the current attribute value
appendAttribute("key","next",JDFCoreConstants.EMPTYSTRING,JDFCoreConstants .COMMA) applied to public static boolean isWildCard(String nodeName)
nodeName
- the argument to testpublic boolean fitsName(String nodeName, String nameSpaceURI)
nodeName
- the name of the node to test. May be either local or qualifiednameSpaceURI
- the namespace of the node to test.public String getNamespaceURIFromPrefix(String prefix)
prefix
- the prefix to check forpublic String getNamespaceURI()
getNamespaceURI
in interface Node
getNamespaceURI
in class org.apache.xerces.dom.ElementNSImpl
public static String xmlnsPrefix(String nodeName)
nodeName
- string to parse@Deprecated public static String getLocalNameStatic(KElement kElem)
kElem
- the element to get the LocalName frompublic int setAttributes(JDFAttributeMap map)
map
- map of attributes to setpublic int setAttributes(KElement kElem)
kElem
- the attribute sourcepublic void setAttributesRaw(KElement kElem)
kElem
- the attribute sourcepublic int setAttributes(KElement kElem, VString ignoreList)
kElem
- the attribute sourceignoreList
- public JDFAttributeMap getAttributeMap()
public JDFAttributeMap getAttributeMap_KElement()
public boolean init()
public KElement appendElement(String elementName, String nameSpaceURI)
elementName
- the elementname with namespace prefix "xyz:abc"nameSpaceURI
- the namespace of the element "null" is valid if the namespace was specified already above. The method will lookup the namespace for
you. Performance wise its better to add it nevertheless.JDFException
- if you tried to append an element into an unspecified namespacepublic KElement appendElementRaw(String elementName, String nameSpaceURI)
elementName
- element namenameSpaceURI
- element namespacepublic KElement appendElement(String elementName)
elementName
- the name of the element to appendpublic void copyElements(VElement v, KElement beforeChild)
v
- the vector of elements to append, if null nothing happensbeforeChild
- the child before which to append the elements of the vectorpublic KElement deleteNode()
public KElement[] getChildElementArray()
@Deprecated public VElement getChildElementVector(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize)
nodeName
- element name you are searching fornameSpaceURI
- nameSpace you are searching formAttrib
- attributes you are lokking forbAnd
- if true, a child is only added if it has all attributes specified in Attributes mAttribmaxSize
- maximum size of the element vectorpublic VElement getChildElementVector(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize, boolean bResolveTarget)
nodeName
- element name you are searching fornameSpaceURI
- nameSpace you are searching formAttrib
- attributes you are lokking forbAnd
- if true, a child is only added if it has all attributes specified in Attributes mAttribmaxSize
- maximum size of the element vector (0=any)bResolveTarget
- if true, IDRef elements are followed, dummy at this level but needed in JDFElementpublic VElement getChildElementVector(String nodeName, String nameSpaceURI)
nodeName
- element name you are searching fornameSpaceURI
- nameSpace you are searching forpublic VElement getChildElementVector_KElement(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bAnd, int maxSize)
nodeName
- element name you are searching fornameSpaceURI
- nameSpace you are searching formAttrib
- attributes you are lokking forbAnd
- if true, a child is only added if it has all attributes specified in Attributes mAttribmaxSize
- maximum size of the element vectorgetChildElementVector(java.lang.String, java.lang.String, org.cip4.jdflib.datatypes.JDFAttributeMap, boolean, int)
public void removeChildrenByClass(Class<? extends Node> clazz)
clazz
- the class of the children to zapppublic <a extends KElement> Vector<a> getChildrenByClass(Class<a> clazz, boolean bRecurse, int nMax)
a
- clazz
- bRecurse
- if true recurse through all children, grandchildren etc.nMax
- maximum number to search - if 0 or negative, search allgetChildElementVector(java.lang.String, java.lang.String, org.cip4.jdflib.datatypes.JDFAttributeMap, boolean, int)
public KElement getFirstChildElement()
public KElement getNextSiblingElement()
public KElement getPreviousSiblingElement()
public <a extends KElement> a getNextSiblingElement(Class<a> clazz)
a
- clazz
- the class of the siblingpublic <a extends KElement> a getFirstChildElement(Class<a> clazz)
a
- clazz
- the class of the siblingpublic KElement getNextSiblingElement(String nodeName, String nameSpaceURI)
nodeName
- the name of the siblingnameSpaceURI
- the namespace of the siblingpublic KElement getFirstChildElement(String nodeName, String nameSpaceURI)
nodeName
- the name of the siblingnameSpaceURI
- the namespace of the siblingpublic KElement getPreviousSiblingElement(String nodeName, String nameSpaceURI)
nodeName
- the name of the siblingnameSpaceURI
- the namespace of the siblingpublic boolean includesAttributes(JDFAttributeMap aMap, boolean bAnd)
aMap
- the attribute names to checkbAnd
- true if you want to make sure all given attributes in aMap are present. False if it is enough if only one attribute in aMap is presentpublic boolean includesAttribute(String attName, String attValue)
attName
- the name of the attributeattValue
- the value of the attributepublic VElement getChildrenByTagName(String elementName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd, int maxSize)
elementName
- elementname you are searching fornameSpaceURI
- nameSpace you are searching formAttrib
- map of attributes you are looking for bDirect
- if true, return value is a vector only of all direct child elements. bAnd
- if true, a child is only added, if it includes all attributes, specified in mAttribmaxSize
- maximum size of the element vector. maxSize is ignored if bDirect is falsegetChildElementVector(java.lang.String, java.lang.String, org.cip4.jdflib.datatypes.JDFAttributeMap, boolean, int,
boolean)
public VElement getChildrenByTagName_KElement(String elementName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd, int maxSize)
elementName
- elementname you are searching fornameSpaceURI
- nameSpace you are searching formAttrib
- map of attributes you are looking for bDirect
- if true, return value is a vector only of all direct child elements. bAnd
- if true, a child is only added, if it includes all attributes, specified in mAttribmaxSize
- maximum size of the element vector. maxSize is ignored if bDirect is falsegetChildElementVector(java.lang.String, java.lang.String, org.cip4.jdflib.datatypes.JDFAttributeMap, boolean, int,
boolean)
public VElement getElementsByTagName_KElement(String s, String nameSpaceURI)
s
- the local name of the elements to match onnameSpaceURI
- the namespace URI of the elements to match on@Deprecated public VElement getChildrenWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, boolean bDirect)
nodeName
- elementname you are searching forattName
- attributes you are looking fornameSpaceURI
- nameSpace you are searching forattVal
- value of the attribute you are searching forbDirect
- if true : return only direct children if false : search recursivelypublic KElement getCreateElement(String nodeName)
nodeName
- name of the node from the elementpublic VString getMultipleIDs(String JDFCoreConstants)
JDFCoreConstants
- name of the attribute to test forpublic KElement getCreateElement(String nodeName, String nameSpaceURI, int iSkip)
nodeName
- name of the node from the elementnameSpaceURI
- the name of the namespaceURIiSkip
- which one you wantpublic KElement getCreateElement_KElement(String nodeName, String nameSpaceURI, int iSkip)
nodeName
- name of the child node to getnameSpaceURI
- namespace to search foriSkip
- number of matching child nodes to skippublic KElement getElement(String nodeName)
nodeName
- Name of the nodepublic KElement getElement(String nodeName, String nameSpaceURI, int iSkip)
nodeName
- name of the child node to getnameSpaceURI
- namespace to search foriSkip
- number of matching child nodes to skippublic HashMap<String,KElement> getElementHashMap(String elementName, String elementNS, String attName)
elementName
- the names of the elements, wildcard if nullelementNS
- the namespace URI of the elements, any if nullattName
- the attribute name - MUST not be nullpublic KElement getElement_KElement(String nodeName, String nameSpaceURI, int iSkip)
nodeName
- Name of the nodenameSpaceURI
- Name of the namespaceURI to search iniSkip
- number of element to get, if negative count backwards (-1 is the last)public <a extends KElement> a getElementByClass(Class<a> clazz, int iSkip, boolean bRecurse)
a
- the data type to returnclazz
- java class of the requested elementiSkip
- number of element to get, if negative count backwards (-1 is the last)bRecurse
- if true recurse sub elementspublic KElement getDeepParent(String parentNode, int depth)
parentNode
- name of the parent node to search fordepth
- which one you want to have in order of appearance@Deprecated public KElement getDeepParent(Vector vParentElement, int depth)
vParentElement
- vector with node names to search fordepth
- which one you want to have (in order of appearance)public KElement getDocRoot()
public VString getAttributeVector()
public VString getAttributeVector_KElement()
public KElement getTarget(String id, String attrib)
default: getTarget(id, JDFCoreConstants.ID)
id
- value of the ID tag to searchattrib
- name of the ID tag, defaults to "ID"null
public KElement getTarget_KElement(String id, String attrib)
id
- value of the ID tag to searchattrib
- name of the ID tag, defaults to "ID"public VString getElementNameVector()
@Deprecated public static Element getFirstElementNode(Element parent)
parent
- the node to get the first element node from@Deprecated public static Element getNextElementNode(Element elem)
elem
- the Element to get the next element node frompublic boolean isEqual(KElement kElem)
kElem
- the element to compare@Deprecated public VElement getChildNodes_KElement()
public boolean isAncestor(KElement child)
child
- child to checkpublic int ancestorDistance(KElement child)
child
- child to checkpublic int numChildElements(String node, String nameSpaceURI)
default: numChildElements(null, null)
node
- the nodes with name 'node' to countnameSpaceURI
- the nameSpace to look inpublic int numChildrenByClass(Class<?> clazz, boolean bRecurse)
clazz
- the child classbRecurse
- if true search the treepublic int numChildElements_KElement(String node, String nameSpaceURI)
default: numChildElements_KElement(null, null)
node
- the nodes with name 'node' to countnameSpaceURI
- the nameSpace to look inpublic KElement removeChild(String node, String nameSpaceURI, int n)
node
- name of the child node to remove, if empty; or "*" removes the n'th elementnameSpaceURI
- namespace to search inn
- number of nodes to skip before deletingpublic KElement getChildByTagName(String s, String nameSpaceURI, int index, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd)
default: getChildByTagName(s, null, 0, null, true, true)
s
- elementname you are searching fornameSpaceURI
- nameSpace you are searching forindex
- if more then one child match the condition you can specify which one you want to have via the indexmAttrib
- attributes you are lokking forbDirect
- if true return value is directly the elemement. Otherwise the return value is the node of the found element. Only direct child, not
grandchild etc.bAnd
- if true, a child is only returned if it has all attributes specified in mAttrib@Deprecated public void removeChildren(String nodeName, String nameSpaceURI)
nodeName
and nameSpaceURI
default: removeChildren(nodeName, nameSpaceURI, null)
nodeName
- name of the child node to get, if empty or null remove allnameSpaceURI
- namespace to search inpublic void removeChildren(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib)
nodeName
in the namespace nameSpaceURI
from the parent element
default: removeChildren(null,null,null)
nodeName
- name of the element typ to removenameSpaceURI
- namespace in which the elements are to be removedmAttrib
- map of attributes to matchpublic int removeFromAttribute(String key, String token, String nameSpaceURI, String sep, int nMax)
removeFromAttribute("key","next","",",", -1)
applied to
results in
key
- attribute keytoken
- string to removenameSpaceURI
- namespace of attribute keysep
- separator between the valuesnMax
- maximum number of value instances to remove (-1 = all)public boolean flush()
@Deprecated public Vector getChildNodeVector(int maxSize)
default: getChildNodeVector(0)
maxSize
- public void removeAttributes(Collection<String> attribs)
attribs
- list of attributes to remove, if null, remove allpublic void eraseEmptyAttributes(boolean bRecurse)
bRecurse
- if true, alse recurse subelements, else only local@Deprecated public KElement getDeepElement(String nodeName, String nameSpaceURI, int iSkip)
default: getDeepElement(nodeName, null, 0)
nodeName
- the type of element you want to getnameSpaceURI
- the namespace to search in !!! NOT USED IN FUCTION !!!iSkip
- which element you want to have (order of appearance)@Deprecated public KElement getChildFromList(VString nodeNames, int iSkip)
nodeNames
- iSkip
- public KElement getChildFromList(VString nodeNames, int iSkip, JDFAttributeMap map, boolean bDirect)
default: getChildFromList(nodeNames, 0, null)
nodeNames
- container for the node name stringiSkip
- how many of the found child should be skipedmap
- map of attributes to matchbDirect
- public KElement renameElement(String newName, String nameSpaceURI)
default: renameElement(newName, null)
newName
- the new name of the actual elementnameSpaceURI
- the new nameSpace, ignored if nullpublic void removeExtensions(String nsURI)
nsURI
- the ns uri of the extensions to removepublic KElement moveMe(KElement beforeChild)
beforeChild
- the child to move before, if beforechild is a the document root, do nothing if null, move me to the end of my parentpublic KElement moveElement(KElement src, KElement beforeChild)
null
, an empty KElement is returned.default: moveElement(src, null)
src
- node to move.beforeChild
- child of 'this' to insert src before. If beforeChild is null, src is appended to 'this'JDFException
- if beforeChild is not a child of 'this'protected void clearTargets()
public void moveElements(VElement v, KElement beforeChild)
v
- the vector of elements to append, if null nothing happensbeforeChild
- the child before which to append the elements of the vectorpublic int eraseEmptyNodes(boolean bTrimWhite)
bTrimWhite
- trims whitespace of text, default = truepublic KElement copyElement(KElement src, KElement beforeChild)
default: copyElement(src, null)
src
- node to copy.beforeChild
- child of 'this' to insert src before. If null, src is appendednull
if src is null
.public KElement copyInto(KElement src, boolean bRemove)
src
- bRemove
- if true, remove existing information, else retain and overwrite / mergepublic KElement replaceElement(KElement src)
src
- node, that 'this' will be replaced withpublic long getLongAttribute(String attrib, String nameSpaceURI, long def)
default: getLongAttribute(attrib, null, 0)
attrib
- attribute to parse for an integer attributenameSpaceURI
- nameSpaceURI to search indef
- the default to return if the value is empty or the attribute is not setlong def
is returned.public int getIntAttribute(String attrib, String nameSpaceURI, int def)
default: getIntAttribute(attrib, null, 0)
attrib
- attribute to parse for an integer attributenameSpaceURI
- nameSpaceURI to search indef
- the default to return if the value is not set or the attribute does not existspublic boolean getBoolAttribute(String attrib, String nameSpaceURI, boolean def)
default: getBoolAttribute(attrib, null, false)
attrib
- attribute to parse for a boolean valuenameSpaceURI
- nameSapceURI to search indef
- the default to return if value is not set or the attribute does not existspublic double getRealAttribute(String attrib, String nameSpaceURI, double def)
default: getRealAttribute(attrib, null, 0.0)
attrib
- attribute to parse for a boolean valuenameSpaceURI
- nameSapceURI to search indef
- default to return if none value is set or attribute does not existdef
public KElement getDeepParentNotName(String thisNode)
thisNode
- serch stringpublic KElement getDeepParentChild(String parentNode)
parentNode
- node name to search for@Deprecated public void appendXMLComment(String commentText)
<!-- XMLComment -->
The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xmlcommentText
- the comment to appendpublic Node appendXMLComment(String commentText, KElement beforeChild)
<!-- XMLComment -->
The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xmlcommentText
- the comment to appendbeforeChild
- the child of this that the Comment should be appended before. if null, append the Commentpublic void setXMLComment(String commentText)
<!-- XMLComment -->
in front of this
if an xml Comment node already exists directly in front of
this
, the previous comment is removed The double minus sign '--' is escaped with an underscore '_' in order to ensure valid xmlcommentText
- the comment text to setpublic void appendCData(String cDataText)
<![CDATA[ CData Section ]]>
some character data cDataText
- the text of the XML CData section to appendpublic void appendCData(KElement cDataElem)
<![CDATA[ CData Section ]]>
some character data cDataElem
- the element of the XML CData section to appendpublic void appendText(String textName)
textName
- the text to appendpublic void appendEntityReference(String refName)
refName
- the name of the entity referencepublic KElement appendTextElement(String nodeName, String text)
nodeName
- node name of the text elementtext
- the text to apendpublic KElement mergeElement(KElement kElem, boolean bDelete)
kElem
- the node element to merge with the current nodebDelete
- if true KElement kElem will be deletedpublic KElement getChildWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, int index, boolean bDirect)
default: getChildWithAttribute(nodeName, attName, null,attValue, 0, true)
nodeName
- name of the child node to search forattName
- attribute name to search fornameSpaceURI
- namespace to search forattVal
- the attribute value to search for, Wildcard supported ( null
)index
- if more then one child meets the condition, you can specify the one to return via an indexbDirect
- if true, looks only in direct children, else search through all children, grandchildren etc.public KElement getCreateChildWithAttribute(String nodeName, String attName, String nameSpaceURI, String attVal, int index)
default: getChildWithAttribute(nodeName, attName, null,attValue, 0, true)
nodeName
- name of the child node to search forattName
- attribute name to search fornameSpaceURI
- namespace to search forattVal
- the attribute value to search for, Wildcard supported ( null
)index
- if more then one child meets the condition, you can specify the one to return via an indexpublic boolean hasChildElement(String nodeName, String nameSpaceURI)
default: hasChildElement(String nodeName, null)
nodeName
- name of the node to check fornameSpaceURI
- nameSpaceURI to search inpublic KElement getInheritedElement(String elementName, String nameSpaceURI, int iSkip)
default: getInheritedElement(elementName, null, 0)
elementName
- name of the element to be searchednameSpaceURI
- XML-namespaceiSkip
- leading siblings to be skippedpublic boolean addNameSpace(String strPrefix, String strNameSpaceURI)
strPrefix
- the namespace prefix to setstrNameSpaceURI
- the namespace URI to setpublic void sortChildren()
public void sortChildren(boolean bRecursive)
public void sortChild(KElement e)
e
- public void sortChildren(Comparator<KElement> comparator)
comparator
- the comparator object to sort bypublic void sortChildren(Comparator<KElement> comparator, boolean bRecursive)
comparator
- the comparator object to sort bypublic void sortChild(KElement e, Comparator<KElement> comparator)
e
- the existing element to sortcomparator
- the comparator object to sort bypublic String toString()
toString
in class org.apache.xerces.dom.NodeImpl
Object.toString()
public String toXML()
JDFException
- if an error occurs while serializingpublic String toXML(int indent)
indent
- JDFException
- if an io exception occurs while serializingpublic String toDisplayXML(int indent)
indent
- JDFException
- if an error occurs while serializingpublic void renameAttribute(String oldName, String newName, String nameSpaceURI, String newNameSpaceURI)
default: renameAttribute(oldName, newName, null, null)
oldName
- attribute name to move fromnewName
- attribute name to move tonameSpaceURI
- attribute nameSpaceURI to move fromnewNameSpaceURI
- attribute nameSpaceURI to move the name topublic void renameAttribute(String oldName, String newName)
default: renameAttribute(oldName, newName, null, null)
oldName
- attribute name to move fromnewName
- attribute name to move topublic VString getChildAttributeList(String nodeName, String attName, String nameSpaceURI, String attValue, boolean bDirect, boolean bUnique)
default: getChildAttributeList(nodeName, attName, null, JDFCoreConstants.WILDCARD, true, true)
nodeName
- element name you are searching forattName
- attributes you are looking fornameSpaceURI
- nameSpace you are searching forattValue
- bDirect
- if true return value is a vector of all found elements. Otherwise the returned vector contains only the nodesbUnique
- if you want to make sure, the attribute is unique, set this boolean to true. Otherwise attribute attName is added to the returned vectorpublic KElement insertBefore(String elementName, Node beforeChild, String nameSpaceURI)
null
, insert elementName at the end of the
list of children. If elementName is a DocumentFragment object, all of its children are inserted, in the same order, before beforeChild. If the
elementName is already in the tree, it is removed first.
default: insertBefore(elementName, beforeChild, null)
elementName
- The elementName to insert the element itself will be createdbeforeChild
- The reference element, i.e., the elemente before which the new element must be insertednameSpaceURI
- The namespace to create elementName inpublic VElement getChildrenFromList(VString nodeNames, JDFAttributeMap map, boolean bDirect, VElement v)
nodeNames
- list of node names that fit, both local and qualified node names are checkedmap
- bDirect
- v
- the vector to be filled. if null, a new empty vector will be createdpublic VElement getChildrenIgnoreList(VString nodeNames, boolean bDirect, VElement v)
nodeNames
- list of node names that fit, both local and qualified node names are checkedbDirect
- v
- the vector to be filled. if null, a new empty vector will be createdpublic KElement appendElementN(String elementName, int maxAllowed, String nameSpaceURI)
default: AppendElementN(elementName, maxAllowed, null)
elementName
- name of the new child elementmaxAllowed
- the maximum number of children with defined name and nameSpace, that are allowed for 'this'nameSpaceURI
- nameSpace of the new child elementJDFException
- if more elements with name and namespace then maxAllowed already exist@Deprecated public String buildXPath()
/root/parent/element
null
if parent of this is null (e.g. called on rootnode)@Deprecated public String buildXPath(String relativeTo)
relativeTo
- relative path to which to create an xpath/root/parent/element
null
if parent of this is null (e.g. called on rootnode)public String buildXPath(String relativeTo, int methCountSiblings)
relativeTo
- relative path to which to create an xpathmethCountSiblings
- , if 1 count siblings, i.e. add '[n]' if 0, only specify the path of parents if 2 or 3, add [@ID="id"]/root/parent/element
null
if parent of this is null (e.g. called on rootnode)public String buildRelativeXPath(KElement relativeTo, int methCountSiblings)
relativeTo
- parent element to which to create an xpathmethCountSiblings
- , if 1 count siblings, i.e. add '[n]' if 0, only specify the path of parents if 2 or 3, add [@ID="id"]/root/parent/element
null
if parent of this is null (e.g. called on rootnode)public KElement insertAt(String nodeName, int beforePos, String beforeNode, String nameSpaceURI, String beforeNameSpaceURI)
default: InsertAt(nodeName, beforePos, null, null, null)
nodeName
- name of the new ElementbeforePos
- index of beforeNode, i.e if beforePos = 0, put it before the first occurrencebeforeNode
- name of the node to put it before, default - any name, Wildcard supportednameSpaceURI
- nameSpace of the new nodebeforeNameSpaceURI
- nameSpace of the node to put it before, default - value of nameSpaceURIJDFException
- if 'this' is a null element and thus nothing can be inserted in itpublic void setXPathValue(String path, String value)
path
- XPath abbreviated syntax representation of the attribute, e.g.: parentElement/thisElement@thisAtt
parentElement/thisElement[2]/@thisAtt
parentElement/thisElement[@foo=\"bar\"]/@thisAtt
value
- string to be set as attribute valuepublic void setXPathValues(JDFAttributeMap map)
map
- map of XPath / values to setpublic void setXPathAttribute(String path, String value)
path
- XPath abbreviated syntax representation of the attribute, e.g.: parentElement/thisElement@thisAtt
parentElement/thisElement[2]/@thisAtt
parentElement/thisElement[@foo=\"bar\"]/@thisAtt
value
- string to be set as attribute valueJDFException
- if the defined path is a bad attribute pathpublic boolean hasXPathNode(String path)
path
- the XPath to test forpublic String getXPathAttribute(String path, String def)
path
- XPath abbreviated syntax representation of the attribute, parentElement/thisElement/@thisAtt
parentElement/thisElement[2]/@thisAtt
parentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]/@thisAtt
def
- default value if it doesn't existJDFException
- if the defined path is a bad attribute pathpublic String getInheritedXPathAttribute(String path, String def)
path
- XPath abbreviated syntax representation of the attribute, parentElement/thisElement/@thisAtt
parentElement/thisElement[2]/@thisAtt
parentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]/@thisAtt
def
- default value if it doesn't existJDFException
- if the defined path is a bad attribute pathpublic JDFAttributeMap getXPathAttributeMap(String path)
path
- XPath abbreviated syntax representation of the attribute, parentElement/thisElement/@thisAtt
parentElement/thisElement[2]/@thisAtt
parentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]/@thisAtt
if null, assume .//@*, i.e. all of thisJDFException
- if the defined path is a bad attribute pathpublic JDFAttributeMap getXPathValueMap()
public KElement getXPathElement(String path)
path
- XPath abbreviated syntax representation of the attribute, e.g parentElement/thisElement
parentElement/thisElement[2]
parentElement[@a=\"b\"]/thisElement[./foo/@foo=\"bar\"]
IllegalArgumentException
- if path is not supportedpublic VElement getXPathElementVector(String path, int maxSize)
path
- XPath abbreviated syntax representation of the attribute, e.g parentElement/thisElement
parentElement/thisElement[2]
parentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]
maxSize
- IllegalArgumentException
- if path is not supportedpublic KElement getCreateXPathElement(String path)
path
- XPath abbreviated syntax representation of the attribute, parentElement/thisElement
parentElement/thisElement[2]
parentElement[@a=\"b\"]/thisElement[@foo=\"bar\"]
public boolean hasAttributes()
hasAttributes
in interface Node
hasAttributes
in class org.apache.xerces.dom.ElementImpl
protected boolean hasChildNodes(int nodeType)
nodeType
-
- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
public boolean hasChildElements()
public VElement getTree(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd)
nodeName
- elementname you are searching fornameSpaceURI
- nameSpace you are searching formAttrib
- attributes you are looking for. Wildcards in the attribute map are supportedbDirect
- if true return value is a vector of all direct elements. Otherwise the returned vector contains nodes of arbitrary depthbAnd
- if true, a child is only added if it has all attributes specified in Attributes mAttribpublic KElement getTreeElement(String nodeName, String nameSpaceURI, JDFAttributeMap mAttrib, boolean bDirect, boolean bAnd)
nodeName
- elementname you are searching for.nameSpaceURI
- nameSpace you are searching for.null
mAttrib
- attributes you are looking for bDirect
- if true, return value is a vector of all direct elements.bAnd
- if true, a child is only added if it has all attributes specified in Attributes mAttrib.public String getText(int i)
i
- index of the child text node, you are searching fornull
if the i'th text node does not existspublic String getCData(int i)
i
- index of the CData section child node, you are searching forpublic String getXMLComment(int i)
would return this is a XMLComment
i
- index of the XMLComment child node, you are searching forpublic String copyXPathValue(String dstXPath, KElement src, String srcXPath)
dstXPath
- the destination xpath in this elementsrc
- the source element, if null; use thissrcXPath
- the source xpath, if null same as dstXPathpublic String copyAttribute(String attrib, KElement src, String srcAttrib, String nameSpaceURI, String srcNameSpaceURI)
default: copyAttribute(attrib, src, null, null, null)
attrib
- the name of the attribute to copy (if source attribute is different only the value will be copied)src
- source element where the attribute to be copied residessrcAttrib
- attribute to copy, defaults to the value of attribnameSpaceURI
- of the attribute in the destinationsrcNameSpaceURI
- of the attribute in the source, defaults to the value of nameSpaceURIpublic String copyAttribute(String attrib, KElement src)
default: copyAttribute(attrib, src, null, null, null)
attrib
- the name of the attribute to copy (if source attribute is different only the value will be copied)src
- source element where the attribute to be copied residespublic void moveAttribute(String attrib, KElement src, String srcAttrib, String nameSpaceURI, String srcNameSpaceURI)
default: moveAttribute(attrib, src, null, null, null)
attrib
- where to move the attributesrc
- element to move fromsrcAttrib
- the attribute to move. If empty string, the string attrib is used as source and targetnameSpaceURI
- the namespaceURI to setsrcNameSpaceURI
- public void moveAttribute(String attrib, KElement src)
attrib
- where to move the attributesrc
- element to move frompublic boolean hasChildText()
public String getText()
public void removeAllText()
public KElement pushUp(String newParentName)
newParentName
- name of the parent to recursively search, defaults to any name@Deprecated public int numChildNodes(int nodeType)
nodeType
- DOM nodeType
- count all = 0
- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
public int numChildNodes(int nodeType, boolean bRecurse)
nodeType
- DOM nodeType
- count all = 0
- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
bRecurse
- public boolean removeChildNode(int nodeType, int i)
nodeType
- the DOM NodeType,if 0 count all nodes
- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
i
- index of the child nodes to removepublic void removeChildText(int i)
i
- index of the text node to remove. First node has index 0, second 1, etc.public void removeCData(int i)
i
- index of the CData section child node to removepublic void removeXMLComment(int i)
i
- index of the XMLComment node to removepublic int getNumChildNodes(int nodeType)
nodeType
- the DOM NodeType, if 0 count all nodes
- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
public int getNumChildText()
public int getNumCDatas()
public int getNumXMLComments()
protected Node getChildNode(int nodeType, int iPos)
nodeType
with n = iPosnodeType
- the DOM node type to get
- ELEMENT_NODE = 1
- ATTRIBUTE_NODE = 2
- TEXT_NODE = 3
- CDATA_SECTION_NODE = 4
- ENTITY_REFERENCE_NODE = 5
- ENTITY_NODE = 6
- PROCESSING_INSTRUCTION_NODE = 7
- COMMENT_NODE = 8
- DOCUMENT_NODE = 9
- DOCUMENT_TYPE_NODE = 10
- DOCUMENT_FRAGMENT_NODE = 11
- NOTATION_NODE = 12
- XML_DECL_NODE = 13
iPos
- the index of the node with default 0 for the first occurance@Deprecated public static String xmlNameSpace(String s)
exp:myexampley
would return exp
s
- the qualified name@Deprecated public void setAttributes(String[] myAttributes, String[] strValues)
myAttributes
- array of attributesstrValues
- array of valuesArrayIndexOutOfBoundsException
- if the arrays are not of equal lengthpublic static String xmlnsLocalName(String pc)
pc
- the qualifiedname@Deprecated public static String getXMLNSNameSpace(String pc)
namespace:localname
pc
- the qualified name.public void setXSIType(String typ)
typ
- public String getXSIType()
@Deprecated public static String getXMLNSPrefix(String pc)
ns:foo
will returnns
pc
- string to parsepublic void setText(String text)
text
- XML Text to setJDFException
- if 'this' is a null element and thus nothing can be inserted in itpublic void removeAttribute(String attrib) throws DOMException
removeAttribute
in interface Element
removeAttribute
in class org.apache.xerces.dom.ElementImpl
DOMException
ElementImpl.removeAttribute(java.lang.String)
public void removeAttributeNS(String nameSpaceURI, String attrib) throws DOMException
removeAttributeNS
in interface Element
removeAttributeNS
in class org.apache.xerces.dom.ElementImpl
DOMException
ElementImpl.removeAttributeNS(java.lang.String, java.lang.String)
public Attr removeAttributeNode(Attr arg0) throws DOMException
removeAttributeNode
in interface Element
removeAttributeNode
in class org.apache.xerces.dom.ElementImpl
DOMException
ElementImpl.removeAttributeNode(org.w3c.dom.Attr)
public Attr setAttributeNode(Attr arg0) throws DOMException
setAttributeNode
in interface Element
setAttributeNode
in class org.apache.xerces.dom.ElementImpl
DOMException
ElementImpl.setAttributeNode(org.w3c.dom.Attr)
public Attr setAttributeNodeNS(Attr arg0) throws DOMException
setAttributeNodeNS
in interface Element
setAttributeNodeNS
in class org.apache.xerces.dom.ElementImpl
DOMException
ElementImpl.setAttributeNodeNS(org.w3c.dom.Attr)
public void setAttributeNS(String nsURI, String arg1, String arg2) throws DOMException
setAttributeNS
in interface Element
setAttributeNS
in class org.apache.xerces.dom.ElementImpl
DOMException
ElementImpl.setAttributeNS(java.lang.String, java.lang.String, java.lang.String)
public void normalize()
public void setNodeValue(String arg0) throws DOMException
setNodeValue
in interface Node
setNodeValue
in class org.apache.xerces.dom.NodeImpl
DOMException
NodeImpl.setNodeValue(java.lang.String)
public void setPrefix(String arg0) throws DOMException
setPrefix
in interface Node
setPrefix
in class org.apache.xerces.dom.ElementNSImpl
DOMException
ElementNSImpl.setPrefix(java.lang.String)
public void setNamespaceURI(String arg0) throws DOMException
arg0
- the ns uri to setDOMException
public Node appendChild(Node arg0) throws DOMException
appendChild
in interface Node
appendChild
in class org.apache.xerces.dom.NodeImpl
DOMException
NodeImpl.appendChild(org.w3c.dom.Node)
public Node removeChild(Node arg0) throws DOMException
removeChild
in interface Node
removeChild
in class org.apache.xerces.dom.ParentNode
DOMException
ParentNode.removeChild(org.w3c.dom.Node)
public Node insertBefore(Node arg0, Node arg1) throws DOMException
insertBefore
in interface Node
insertBefore
in class org.apache.xerces.dom.ParentNode
DOMException
ParentNode.insertBefore(org.w3c.dom.Node, org.w3c.dom.Node)
public Node replaceChild(Node arg0, Node arg1) throws DOMException
replaceChild
in interface Node
replaceChild
in class org.apache.xerces.dom.ParentNode
DOMException
ParentNode.replaceChild(org.w3c.dom.Node, org.w3c.dom.Node)
public void removeXPathAttribute(String path)
path
- the XPath to the attribute that is to be removedJDFException
- if the XPath is corruptpublic void removeXPathElement(String path)
path
- the XPath to the attribute that is to be removedJDFException
- if the XPath is corrupt@Deprecated public boolean matchesPath(String path)
path
- public boolean matchesPath(String path, boolean bFollowRefs)
path
- xpath to match may include syntax e[i]
or e[@a="b"]
bFollowRefs
- protected boolean matchesPathName(String pathAt)
public final HashSet<String> fillHashSet(String attName, String attNS)
attName
- the attribute to searchattNS
- the namespace of the attributepublic KElement clone()
clone
in class Object
Object.clone()
public KElement cloneNewDoc()
Object.clone()
public String appendAnchor(String newID)
newID
- the new id. if null, then a reasonably unique id is generatedpublic String getID()
public String generateDotID(String key, String nameSpaceURI)
key
- the attribute that is to be set to this ID, e.g. jobpartidnameSpaceURI
- the attribute namespace that is to be set to this ID, e.g. jobpartidprotected String getIDPrefix()
public void setID(String id)
id
- public static void setLongID(boolean bLong)
bLong
- if true (default), the date and time is used to generate long IDspublic static String uniqueID(int id)
id
- the starting id of the ID - should normally be 0 in order to incrementpublic static KElement createRoot(String nodename, String namespaceURI)
nodename
- namespaceURI
- public int numSiblingElements(String elementName, String nameSpaceURI)
elementName
- , if null any and all at the same levelnameSpaceURI
- public boolean write2Stream(OutputStream stream)
stream
- public boolean write2File(File file)
file
- public boolean write2File(String filename)
filename
- Copyright © 2018. All rights reserved.