Package org.geotools.xml

Examples of org.geotools.xml.Parser


    private WFSCapabilitiesType parseCapabilities(InputStream capabilitiesReader)
            throws IOException {

        final Configuration wsConfig = strategy.getWsConfiguration();
        final Parser parser = new Parser(wsConfig);
        final Object parsed;
        try {
            parsed = parser.parse(capabilitiesReader);
        } catch (SAXException e) {
            throw new DataSourceException("Exception parsing WFS 1.1.0 capabilities", e);
        } catch (ParserConfigurationException e) {
            throw new DataSourceException("WFS 1.1.0 parsing configuration error", e);
        }
View Full Code Here


import org.geotools.xml.Parser;

public class CapabilitiesParseTest extends OWSTestSupport {

    public void testParseCapabilities() throws Exception {
        Parser p = new Parser(createConfiguration());
        Object o = p.parse(getClass().getResourceAsStream("exampleCapabilities1.xml"));

        //the core ows schema is abstract, and meant to be extended, so the root caps document
        // is usually declared by the specific schema, since hte ows schema doens't know about it
        // we get back a map
        assertTrue(o instanceof Map);
View Full Code Here

    protected void setUp() throws Exception {
        super.setUp();

        Configuration configuration = new OGCConfiguration();
        parser = new Parser(configuration);
    }
View Full Code Here

            + "    <Literal>bar</Literal>" + "  </PropertyIsEqualTo>" + "</Filter>";

        OGCConfiguration configuration = new OGCConfiguration();
        configuration.getProperties().add(Properties.IGNORE_SCHEMA_LOCATION);

        Parser parser = new Parser(configuration);
        Filter filter = (Filter) parser.parse(new ByteArrayInputStream(xml.getBytes()));
        assertNotNull(filter);
    }
View Full Code Here

          "</Filter>";
      
       OGCConfiguration configuration = new OGCConfiguration();
       configuration.getProperties().add(Properties.IGNORE_SCHEMA_LOCATION);

       Parser parser = new Parser(configuration);
       DWithin filter = (DWithin) parser.parse(new ByteArrayInputStream(xml.getBytes()));
       assertNotNull(filter);
      
       //Asserting the Property Name
       assertNotNull(filter.getExpression1());
       PropertyName propName = (PropertyName) filter.getExpression1();
View Full Code Here

            inputStream = httpResponse.getResponseStream();

            // Map hints = new HashMap();
            // hints.put(DocumentHandler.DEFAULT_NAMESPACE_HINT_KEY, WPSSchema.getInstance());
            Configuration config = new WPSConfiguration();
            Parser parser = new Parser(config);

            Object object;
            excepResponse = null;
            processDescs = null;
            try
            {
                // object = DocumentFactory.getInstance(inputStream, hints, Level.WARNING);
                object = parser.parse(inputStream);
            }
            catch (SAXException e)
            {
                throw (IOException) new IOException().initCause(e);
            }
View Full Code Here

    private void parseDocumentResponse(InputStream inputStream) throws IOException {
        // Map hints = new HashMap();
        // hints.put(DocumentHandler.DEFAULT_NAMESPACE_HINT_KEY, WPSSchema.getInstance());
        Configuration config = new WPSConfiguration();
        Parser parser = new Parser(config);

        Object object;
        excepResponse = null;
        exeResponse = null;
        try
        {
            // object = DocumentFactory.getInstance(inputStream, hints, Level.WARNING);
            object = parser.parse(inputStream);
        }
        catch (SAXException e)
        {
            throw (IOException) new IOException().initCause(e);
        }
View Full Code Here

            // Map hints = new HashMap();
            // hints.put(DocumentHandler.DEFAULT_NAMESPACE_HINT_KEY, WPSSchema.getInstance());
            // hints.put(DocumentFactory.VALIDATION_HINT, Boolean.FALSE);
            Configuration config = new WPSConfiguration();
            Parser parser = new Parser(config);

            Object object;
            excepResponse = null;
            capabilities = null;
            try
            {
                // object = DocumentFactory.getInstance(inputStream, hints, Level.WARNING);
                object = parser.parse(inputStream);
            }
            catch (SAXException e)
            {
                throw (ServiceException) new ServiceException("Error while parsing XML.").initCause(e);
            }
View Full Code Here

        "<DWithin/>" +
        "</Spatial_Operators>" +
        "</Spatial_Capabilities>" +
        "</Filter_Capabilities>";
       
        Parser parser = new Parser(createConfiguration());
        FilterCapabilities caps = (FilterCapabilities) parser.parse(new ByteArrayInputStream(xml.getBytes()));
        assertEquals(FilterCapabilities.VERSION_100, caps.getVersion());
        assertNotNull(caps.getScalarCapabilities());
        assertNotNull(caps.getSpatialCapabilities());
    }
View Full Code Here

    Parser p;

    @Override
    protected void setUp() throws Exception {
        XSConfiguration xs = new XSConfiguration();
        p = new Parser(xs);
    }
View Full Code Here

TOP

Related Classes of org.geotools.xml.Parser

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.