Package org.w3c.dom

Examples of org.w3c.dom.Attr


    throws Exception
  {
    String name = (String) element.getAttribute("name");
    if (name.equals(""))
      throw error(L.l("{0} expects `{1}' attribute.", "xsl:element", "name"));
    Attr nsAttr = element.getAttributeNode("namespace");

    if (nsAttr == null)
      printElement(element, name);
    else
      printElement(element, name, nsAttr.getNodeValue());
  }
View Full Code Here


  {
    String name = (String) element.getAttribute("name");
    if (name.equals(""))
      throw error(L.l("{0} expects `{1}' attribute",
                      "xsl:attribute", "name"));
    Attr nsAttr = element.getAttributeNode("namespace");

    boolean oldSpecial = _isSpecial;
    _isSpecial = true;
   
    if (nsAttr == null)
      printAttribute(element, name);
    else
      printAttribute(element, name, nsAttr.getNodeValue());

    _isSpecial = oldSpecial;
  }
View Full Code Here

    setAttributeNode(_owner.createAttribute(name, value));
  }

  public void setAttributeNS(String uri, String local, String value)
  {
    Attr attr = _owner.createAttributeNS(uri, local);
    attr.setNodeValue(value);
   
    setAttributeNodeNS(attr);
  }
View Full Code Here

     * @throws SAXException
     */
    private void initAttributeNode(Node node, DefaultMutableTreeNode mTreeNode) throws SAXException {
        NamedNodeMap nm = node.getAttributes();
        for (int i = 0; i < nm.getLength(); i++) {
            Attr nmNode = (Attr) nm.item(i);
            String value = nmNode.getName() + " = \"" + nmNode.getValue() + "\""; // $NON-NLS-1$ $NON-NLS-2$
            XMLDefaultMutableTreeNode attributeNode = new XMLDefaultMutableTreeNode(value, nmNode);
            mTreeNode.add(attributeNode);

        }
    }
View Full Code Here

        NamedNodeMap attributes = wrappedNode.getAttributes();
        Node attrNode = attributes.getNamedItemNS(namespaceURI, localName);
        if(attrNode == null) {
            return null;
        } else {
            Attr attribute = (Attr) attrNode;
            return attribute.getValue();
        }
    }
View Full Code Here

        NamedNodeMap attributes = wrappedNode.getAttributes();
        Node attrNode = attributes.getNamedItem(localName);
        if(attrNode == null) {
            return null;
        } else {
            Attr attribute = (Attr) attrNode;
            return attribute.getValue();
        }
    }
View Full Code Here

                // Copy element's attributes, if any.
                NamedNodeMap sourceAttrs = source.getAttributes();
                if (sourceAttrs != null) {
                    int length = sourceAttrs.getLength();
                    for (int index = 0; index < length; index++) {
                        Attr attr = (Attr)sourceAttrs.item(index);

                        // NOTE: this methods is used for both importingNode
                        // and cloning the document node. In case of the
                        // clonning default attributes should be copied.
                        // But for importNode defaults should be ignored.
                        if (attr.getSpecified() || cloningDoc) {
                            Attr newAttr = (Attr)importNode(attr, true, cloningDoc,
                            reversedIdentifiers);

                            // Attach attribute according to namespace
                            // support/qualification.
                            if (domLevel20 == false ||
View Full Code Here

     * @throws XMLSecurityException
     */
    private static XMLSignatureInput resolveInput(
        RetrievalMethod rm, String baseURI, boolean secureValidation
    ) throws XMLSecurityException {
        Attr uri = rm.getURIAttr();
        // Apply the transforms
        Transforms transforms = rm.getTransforms();
        ResourceResolver resRes = ResourceResolver.getInstance(uri, baseURI, secureValidation);
        XMLSignatureInput resource = resRes.resolve(uri, baseURI, secureValidation);
        if (transforms != null) {
View Full Code Here

     * @return the KeyInfo which is referred to by this KeyInfoReference, or null if can not be resolved
     * @throws XMLSecurityException
     */
    private KeyInfo resolveReferentKeyInfo(Element element, String baseURI, StorageResolver storage) throws XMLSecurityException {
        KeyInfoReference reference = new KeyInfoReference(element, baseURI);
        Attr uriAttr = reference.getURIAttr();

        XMLSignatureInput resource = resolveInput(uriAttr, baseURI, secureValidation);

        Element referentElement = null;
        try {
            referentElement = obtainReferenceElement(resource);
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
                log.debug("XMLSecurityException", e);
            }
            return null;
        }

        if (referentElement == null) {
            log.debug("De-reference of KeyInfoReference URI returned null: " + uriAttr.getValue());
            return null;
        }

        validateReference(referentElement);

View Full Code Here

        if (namespace == null) {
            String qname = "xmlns:" + prefix;
            Node aNode = node;
            while (aNode != null) {
                if (aNode.getNodeType() == Node.ELEMENT_NODE) {
                    Attr attr = ((Element) aNode).getAttributeNode(qname);
                    if (attr != null) {
                        namespace = attr.getValue();
                        break;
                    }
                }
                aNode = aNode.getParentNode();
            }
View Full Code Here

TOP

Related Classes of org.w3c.dom.Attr

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.