Package org.apache.xerces.dom

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


              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.createElementNS("http://nsa", "foo:a").getNamespaceURI(), "http://nsa");
  Assertion.verify(DOMExceptionsTest(doc, "createElementNS",
              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
        Element elem = doc.createElementNS("http://nsa", "foo:a");
        elem.setPrefix("bar");
        Assertion.equals(elem.getNodeName(), "bar:a");
        Assertion.equals(elem.getNamespaceURI(), "http://nsa");
        Assertion.equals(elem.getPrefix(), "bar");
        Assertion.equals(elem.getLocalName(), "a");
View Full Code Here

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

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

        Assertion.equals(elem.getLocalName(), "a");
        Assertion.equals(elem.getTagName(), "bar:a");
        //Special case for xml:a where namespaceURI must be xmlURI
        elem = doc.createElementNS(xmlURI, "foo:a");
        elem.setPrefix("xml");
        elem = doc.createElementNS("http://nsa", "foo:a");
        Assertion.verify(DOMExceptionsTest(elem, "setPrefix",
            new Class[]{String.class},
            new Object[]{"xml"},
            DOMException.NAMESPACE_ERR));
        //However, there is no restriction on prefix xmlns
View Full Code Here

            new Object[]{"xml"},
            DOMException.NAMESPACE_ERR));
        //However, there is no restriction on prefix xmlns
        elem.setPrefix("xmlns");
        //Also an element can not have a prefix with namespaceURI == null
        elem = doc.createElementNS(null, "a");
        Assertion.verify(DOMExceptionsTest(elem, "setPrefix",
            new Class[]{String.class},
            new Object[]{"foo"},
            DOMException.NAMESPACE_ERR));
View Full Code Here

        Element rootEl = doc.getDocumentElement();

        //
        // Populate the document
        //
        Element ela = doc.createElementNS("http://nsa", "a:ela")
        rootEl.appendChild(ela);
        Element elb = doc.createElementNS("http://nsb", "elb");  
        rootEl.appendChild(elb);
        Element elc = doc.createElementNS(null,           "elc")
        rootEl.appendChild(elc);
View Full Code Here

        //
        // Populate the document
        //
        Element ela = doc.createElementNS("http://nsa", "a:ela")
        rootEl.appendChild(ela);
        Element elb = doc.createElementNS("http://nsb", "elb");  
        rootEl.appendChild(elb);
        Element elc = doc.createElementNS(null,           "elc")
        rootEl.appendChild(elc);
        Element eld = doc.createElementNS("http://nsa", "d:ela");
        rootEl.appendChild(eld);
View Full Code Here

        //
        Element ela = doc.createElementNS("http://nsa", "a:ela")
        rootEl.appendChild(ela);
        Element elb = doc.createElementNS("http://nsb", "elb");  
        rootEl.appendChild(elb);
        Element elc = doc.createElementNS(null,           "elc")
        rootEl.appendChild(elc);
        Element eld = doc.createElementNS("http://nsa", "d:ela");
        rootEl.appendChild(eld);
        Element ele = doc.createElementNS("http://nse", "elb");  
        rootEl.appendChild(ele);
View Full Code Here

        rootEl.appendChild(ela);
        Element elb = doc.createElementNS("http://nsb", "elb");  
        rootEl.appendChild(elb);
        Element elc = doc.createElementNS(null,           "elc")
        rootEl.appendChild(elc);
        Element eld = doc.createElementNS("http://nsa", "d:ela");
        rootEl.appendChild(eld);
        Element ele = doc.createElementNS("http://nse", "elb");  
        rootEl.appendChild(ele);

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.