for (int i = 0; i < attributes.getLength(); i++) { Attr attr = (Attr)attributes.item(i); if (attr.isId() && id.equals(attr.getValue()) && se != knownElement) { log.debug("Multiple elements with the same 'Id' attribute value!"); return false;
for (int i = 0; i < attributes.getLength(); i++) { Attr attr = (Attr)attributes.item(i); if (attr.isId() && id.equals(attr.getValue())) { if (foundElement == null) {
/** * This implementation walks the entire document looking for an element * with the given ID attribute. We should consider adding an index to speed * navigation of large documents. */ Element getElementById(String name) { for (Attr attr : attributes) { if (attr.isId() && name.equals(attr.getValue())) { return this; } } /* * TODO: Remove this behavior. * The spec explicitly says that this is a bad idea. From * Document.getElementById(): "Attributes with the name "ID" * or "id" are not of type ID unless so defined. */ if (name.equals(getAttribute("id"))) { return this; } for (NodeImpl node : children) { if (node.getNodeType() == Node.ELEMENT_NODE) { Element element = ((ElementImpl) node).getElementById(name); if (element != null) { return element; } } } return null; }
/** * Determine whether this node has the is-id property * * @return true if the node is an ID */ public boolean isId() { synchronized (docWrapper.docNode) { return (node instanceof Attr) && ((Attr) node).isId(); } }
/** {@inheritDoc} */ @Override protected void processAttribute(@Nonnull final XMLObject xmlObject, @Nonnull final Attr attribute) throws UnmarshallingException { XSAny xsAny = (XSAny) xmlObject; QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute.getPrefix()); if (attribute.isId()) { xsAny.getUnknownAttributes().registerID(attribQName); } xsAny.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ @Override protected void processAttribute(@Nonnull final XMLObject xmlObject, @Nonnull final Attr attribute) throws UnmarshallingException { XSAny xsAny = (XSAny) xmlObject; QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute.getPrefix()); if (attribute.isId()) { xsAny.getUnknownAttributes().registerID(attribQName); } xsAny.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { Body body = (Body) xmlObject; QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { body.getUnknownAttributes().registerID(attribQName); } body.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { AuthnContextDecl authnCtcDecl = (AuthnContextDecl) xmlObject; QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { authnCtcDecl.getUnknownAttributes().registerID(attribQName); } authnCtcDecl.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { XSAny xsAny = (XSAny) xmlObject; QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { xsAny.getUnknownAttributes().registerID(attribQName); } xsAny.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { Header header = (Header) xmlObject; QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { header.getUnknownAttributes().registerID(attribQName); } header.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { Detail detail = (Detail) xmlObject; QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { detail.getUnknownAttributes().registerID(attribQName); } detail.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { Header header = (Header) xmlObject; QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { header.getUnknownAttributes().registerID(attribQName); } header.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { AuthnContextDecl authnCtcDecl = (AuthnContextDecl) xmlObject; QName attribQName = QNameSupport.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { authnCtcDecl.getUnknownAttributes().registerID(attribQName); } authnCtcDecl.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { XSAny xsAny = (XSAny) xmlObject; QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { xsAny.getUnknownAttributes().registerID(attribQName); } xsAny.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { Envelope envelope = (Envelope) xmlObject; QName attribQName = XMLHelper.constructQName(attribute.getNamespaceURI(), attribute.getLocalName(), attribute .getPrefix()); if (attribute.isId()) { envelope.getUnknownAttributes().registerID(attribQName); } envelope.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(final XMLObject xmlObject, final Attr attribute) throws UnmarshallingException { final KeyAuthority authority = (KeyAuthority) xmlObject; if (attribute.getLocalName().equals(KeyAuthority.VERIFY_DEPTH_ATTRIB_NAME)) { authority.setVerifyDepth(Integer.valueOf(attribute.getValue())); } else { final QName attribQName = QNameSupport.getNodeQName(attribute); if (attribute.isId()) { authority.getUnknownAttributes().registerID(attribQName); } authority.getUnknownAttributes().put(attribQName, attribute.getValue()); } }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { AttributeValueType attributeValue = (AttributeValueType) xmlObject; QName attribQName = XMLHelper.getNodeQName(attribute); if (attribute.isId()) { attributeValue.getUnknownAttributes().registerID(attribQName); } attributeValue.getUnknownAttributes().put(attribQName, attribute.getValue()); if(attribute.getLocalName().equals(AttributeValueType.DATA_TYPE_ATTRIB_NAME)){ attributeValue.setDataType(DatatypeHelper.safeTrimOrNullString(attribute.getValue())); } }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { ResourceContentType resourceContent = (ResourceContentType) xmlObject; QName attribQName = XMLHelper.getNodeQName(attribute); if (attribute.isId()) { resourceContent.getUnknownAttributes().registerID(attribQName); } resourceContent.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** {@inheritDoc} */ protected void processAttribute(XMLObject xmlObject, Attr attribute) throws UnmarshallingException { AttributeValueType attributeValue = (AttributeValueType) xmlObject; QName attribQName = XMLHelper.getNodeQName(attribute); if (attribute.isId()) { attributeValue.getUnknownAttributes().registerID(attribQName); } attributeValue.getUnknownAttributes().put(attribQName, attribute.getValue()); }
/** * {@inheritDoc} */ protected void processAttribute(XMLObject samlObject, Attr attribute) throws UnmarshallingException { Organization org = (Organization) samlObject; QName attribQName = XMLHelper.getNodeQName(attribute); if (attribute.isId()) { org.getUnknownAttributes().registerID(attribQName); } org.getUnknownAttributes().put(attribQName, attribute.getValue()); } }