Package org.apache.xerces.dom

Examples of org.apache.xerces.dom.DocumentImpl.createAttributeNS()


              new Object[]{null,  "xml:a"},
              DOMException.NAMESPACE_ERR));

        //xmlns must have namespaceURI == "http://www.w3.org/2000/xmlns/"
        String xmlnsURI = "http://www.w3.org/2000/xmlns/";
        Assertion.equals(doc.createAttributeNS(xmlnsURI, "xmlns").getNamespaceURI(), xmlnsURI);
        Assertion.verify(DOMExceptionsTest(doc, "createAttributeNS",
              new Class[]{String.class, String.class},
              new Object[]{"http://nsa", "xmlns"},
              DOMException.NAMESPACE_ERR));
        Assertion.verify(DOMExceptionsTest(doc, "createAttributeNS",
View Full Code Here


              new Class[]{String.class, String.class},
              new Object[]{null,  "xmlns"},
              DOMException.NAMESPACE_ERR));

        //xmlns:a must have namespaceURI == "http://www.w3.org/2000/xmlns/"
        Assertion.equals(doc.createAttributeNS(xmlnsURI, "xmlns:a").getNamespaceURI(), xmlnsURI);
        Assertion.verify(DOMExceptionsTest(doc, "createAttributeNS",
              new Class[]{String.class, String.class},
              new Object[]{"http://nsa", "xmlns:a"},
              DOMException.NAMESPACE_ERR));
        Assertion.verify(DOMExceptionsTest(doc, "createAttributeNS",
View Full Code Here

              new Class[]{String.class, String.class},
              new Object[]{null,  "xmlns:a"},
              DOMException.NAMESPACE_ERR));

        //In fact, any prefix != null should have a namespaceURI != null
        Assertion.equals(doc.createAttributeNS("http://nsa", "foo:a").getNamespaceURI(), "http://nsa");
        Assertion.verify(DOMExceptionsTest(doc, "createAttributeNS",
              new Class[]{String.class, String.class},
              new Object[]{null,  "foo:a"},
              DOMException.NAMESPACE_ERR));
View Full Code Here

              new Class[]{String.class, String.class},
              new Object[]{null,  "foo:a"},
              DOMException.NAMESPACE_ERR));

        //Change prefix
        Attr attr = doc.createAttributeNS("http://nsa", "foo:a");
        attr.setPrefix("bar");
        Assertion.equals(attr.getNodeName(), "bar:a");
        Assertion.equals(attr.getNamespaceURI(), "http://nsa");
        Assertion.equals(attr.getPrefix(), "bar");
        Assertion.equals(attr.getLocalName(), "a");
View Full Code Here

        Assertion.equals(attr.getNamespaceURI(), "http://nsa");
        Assertion.equals(attr.getPrefix(), "bar");
        Assertion.equals(attr.getLocalName(), "a");
        Assertion.equals(attr.getName(), "bar:a");
        //The spec does not prevent us from setting prefix to a node without prefix
        attr = doc.createAttributeNS("http://nsa", "a");
        Assertion.verify(attr.getPrefix() == null);
        attr.setPrefix("bar");
        Assertion.equals(attr.getNodeName(), "bar:a");
        Assertion.equals(attr.getNamespaceURI(), "http://nsa");
        Assertion.equals(attr.getPrefix(), "bar");
View Full Code Here

        Assertion.equals(attr.getNamespaceURI(), "http://nsa");
        Assertion.equals(attr.getPrefix(), "bar");
        Assertion.equals(attr.getLocalName(), "a");
        Assertion.equals(attr.getName(), "bar:a");
        //Special case for xml:a where namespaceURI must be xmlURI
        attr = doc.createAttributeNS(xmlURI, "foo:a");
        attr.setPrefix("xml");
        attr = doc.createAttributeNS("http://nsa", "foo:a");
        Assertion.verify(DOMExceptionsTest(attr, "setPrefix",
             new Class[]{String.class},
             new Object[]{"xml"},
View Full Code Here

        Assertion.equals(attr.getLocalName(), "a");
        Assertion.equals(attr.getName(), "bar:a");
        //Special case for xml:a where namespaceURI must be xmlURI
        attr = doc.createAttributeNS(xmlURI, "foo:a");
        attr.setPrefix("xml");
        attr = doc.createAttributeNS("http://nsa", "foo:a");
        Assertion.verify(DOMExceptionsTest(attr, "setPrefix",
             new Class[]{String.class},
             new Object[]{"xml"},
             DOMException.NAMESPACE_ERR));
        //Special case for xmlns:a where namespaceURI must be xmlURI
View Full Code Here

        Assertion.verify(DOMExceptionsTest(attr, "setPrefix",
             new Class[]{String.class},
             new Object[]{"xml"},
             DOMException.NAMESPACE_ERR));
        //Special case for xmlns:a where namespaceURI must be xmlURI
        attr = doc.createAttributeNS("http://nsa", "foo:a");
        Assertion.verify(DOMExceptionsTest(attr, "setPrefix",
             new Class[]{String.class},
             new Object[]{"xmlns"},
             DOMException.NAMESPACE_ERR));
        //Special case for xmlns where no prefix can be set
View Full Code Here

        Assertion.verify(DOMExceptionsTest(attr, "setPrefix",
             new Class[]{String.class},
             new Object[]{"xmlns"},
             DOMException.NAMESPACE_ERR));
        //Special case for xmlns where no prefix can be set
        attr = doc.createAttributeNS(xmlnsURI, "xmlns");
        Assertion.verify(DOMExceptionsTest(attr, "setPrefix",
             new Class[]{String.class},
             new Object[]{"xml"},
             DOMException.NAMESPACE_ERR));
        //Also an attribute can not have a prefix with namespaceURI == null
View Full Code Here

        Assertion.verify(DOMExceptionsTest(attr, "setPrefix",
             new Class[]{String.class},
             new Object[]{"xml"},
             DOMException.NAMESPACE_ERR));
        //Also an attribute can not have a prefix with namespaceURI == null
        attr = doc.createAttributeNS(null, "a");
        Assertion.verify(DOMExceptionsTest(attr, "setPrefix",
             new Class[]{String.class},
             new Object[]{"foo"},
             DOMException.NAMESPACE_ERR));
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.