Package org.w3c.dom.ls

Examples of org.w3c.dom.ls.LSParser.parseURI()


            //       lookupNamespaceURI
            //----------------------------
            //System.out.println("TEST #1: lookupPrefix, isDefaultNamespace, lookupNamespaceURI, input: tests/dom/dom3/input.xml");
            {

                Document doc = builder.parseURI("tests/dom/dom3/input.xml");
                NodeList ls = doc.getElementsByTagName("a:elem_a");

                NodeImpl elem = (NodeImpl)ls.item(0);
                if (namespaces) {
                    //System.out.println("[a:elem_a].lookupPrefix('http://www.example.com', true) == null");
View Full Code Here


            {
                errorCounter = 0;
                config = builder.getDomConfig();
                config.setParameter("error-handler",errorHandler);
                config.setParameter("validate", Boolean.TRUE);
                Document core = builder.parseURI("tests/dom/dom3/schema.xml");
                Assertion.verify(errorCounter == 0, "No errors should be reported");
               
                errorCounter = 0;   
                NodeList ls2 = core.getElementsByTagName("decVal");
                Element testElem = (Element)ls2.item(0);
View Full Code Here

                errorCounter = 0;
                config = builder.getDomConfig();
                config.setParameter("error-handler",errorHandler);
                config.setParameter("validate", Boolean.TRUE);
                config.setParameter("psvi", Boolean.TRUE);
                Document core = builder.parseURI("data/personal-schema.xml");
                Assertion.verify(errorCounter == 0, "No errors should be reported");

                NodeList ls2 = core.getElementsByTagName("person");

                Element testElem = (Element)ls2.item(0);
View Full Code Here

           {
            config = builder.getDomConfig();
            config.setParameter("error-handler",errorHandler);
            config.setParameter("validate", Boolean.FALSE);
            config.setParameter("entities", Boolean.TRUE);
            Document doc = builder.parseURI("tests/dom/dom3/wholeText.xml");

            Element root = doc.getDocumentElement();
            Element test = (Element)doc.getElementsByTagName("elem").item(0);
           
            test.appendChild(doc.createTextNode("Address: "));
View Full Code Here

                config.setParameter("validate", Boolean.TRUE);
                config.setParameter("psvi", Boolean.TRUE);
               
                // schema-type is not set validate against both grammars
                errorCounter = 0;
                Document core2 = builder.parseURI("tests/dom/dom3/both-error.xml");
                Assertion.verify(errorCounter == 4, "4 errors should be reported");
               
                errorCounter = 0;
                // set schema-type to be XML Schema
                config.setParameter("schema-type", "http://www.w3.org/2001/XMLSchema");
View Full Code Here

               
                errorCounter = 0;
                // set schema-type to be XML Schema
                config.setParameter("schema-type", "http://www.w3.org/2001/XMLSchema");
                // test parsing a file that has both XML schema and DTD
                core2 = builder.parseURI("tests/dom/dom3/both.xml");
                Assertion.verify(errorCounter == 0, "No errors should be reported");
               
           
                // parse a file with XML schema and DTD but validate against DTD only
                errorCounter = 0;
View Full Code Here

               
           
                // parse a file with XML schema and DTD but validate against DTD only
                errorCounter = 0;
                config.setParameter("schema-type","http://www.w3.org/TR/REC-xml");
                core2 = builder.parseURI("tests/dom/dom3/both-error.xml");
                Assertion.verify(errorCounter == 3, "3 errors should be reported");
               
                // parse a file with DTD only but set schema-location and
                // validate against XML Schema
                // set schema location
View Full Code Here

                // parse a file with DTD only but set schema-location and
                // validate against XML Schema
                // set schema location
               
               
                core2 = builder.parseURI("tests/dom/dom3/both-error.xml");
               
                // normalize document
                errorCounter = 0;
                Element root = core2.getDocumentElement();
                root.removeAttributeNS("http://www.w3.org/2001/XMLSchema", "xsi");              
View Full Code Here

           
            // baseURI tests
            {
        LSParser parser = impl.createLSParser(DOMImplementationLS.MODE_SYNCHRONOUS,
                               null);
        Document doc = parser.parseURI("tests/dom/dom3/baseURI.xml");
        Element root = doc.getDocumentElement();
        NodeList ls = doc.getElementsByTagNameNS(null, "streetNum");
        Node e = ls.item(0);
        Assertion.verify(((NodeImpl)e).getBaseURI().endsWith("tests/dom/dom3/baseURI.xml"),
                 "baseURI=tests/dom/dom3/baseURI.xml");
View Full Code Here

    public List<File> getConfigImports(File configFile) {
        LSParser parser = XMLUtils.createLSParser();

        GetSpringImportsFilter filter = new GetSpringImportsFilter(configFile);
        parser.setFilter(filter);
        parser.parseURI(configFile.toURI().toString());

        return filter.getImportedFiles();
    }
   
    /**
 
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.