/** * Gets the ancestor element node to the given node. * * @param currentNode the node to retrive the ancestor for * * @return the ancestral element node of the current node, or null */ public static Element getElementAncestor(Node currentNode) { Node parent = currentNode.getParentNode(); if (parent != null) { short type = parent.getNodeType(); if (type == Node.ELEMENT_NODE) { return (Element) parent; } return getElementAncestor(parent); } return null; }
/** * Gets the ancestor element node to the given node. * * @param currentNode the node to retrive the ancestor for * * @return the ancestral element node of the current node, or null */ public static Element getElementAncestor(Node currentNode) { Node parent = currentNode.getParentNode(); if (parent != null) { short type = parent.getNodeType(); if (type == Node.ELEMENT_NODE) { return (Element) parent; } return getElementAncestor(parent); } return null; }
Element ancestor = getElementAncestor(startingElement); if (ancestor != null) { return lookupNamespaceURI(ancestor, stopingElement, prefix);
Element ancestor = getElementAncestor(startingElement); if (ancestor != null) { return lookupNamespaceURI(ancestor, stopingElement, prefix);
Element ancestor = getElementAncestor(startingElement); if (ancestor != null) { return lookupPrefix(ancestor, stopingElement, namespaceURI);
Element ancestor = getElementAncestor(startingElement); if (ancestor != null) { return lookupPrefix(ancestor, stopingElement, namespaceURI);
/** {@inheritDoc} */ protected void unmarshallTextContent(XMLObject xmlObject, Text content) throws UnmarshallingException { String textContent = DatatypeHelper.safeTrimOrNullString(content.getWholeText()); if (textContent != null) { XSQName qname = (XSQName) xmlObject; qname.setValue(XMLHelper.constructQName(textContent, XMLHelper.getElementAncestor(content))); } } }
/** {@inheritDoc} */ protected void unmarshallTextContent(XMLObject xmlObject, Text content) throws UnmarshallingException { String textContent = DatatypeHelper.safeTrimOrNullString(content.getWholeText()); if (textContent != null) { XSQName qname = (XSQName) xmlObject; qname.setValue(XMLHelper.constructQName(textContent, XMLHelper.getElementAncestor(content))); } } }