Package org.apache.excalibur.xml.dom

Examples of org.apache.excalibur.xml.dom.DOMParser


        if ((namespace.equals(m_namespace)) &&
                (name.equals(m_propertyname)) &&
                (source.getURI().endsWith(m_extension))) {

            DOMParser parser = null;
            Document doc = null;
            try {
                parser = (DOMParser) manager.lookup(DOMParser.ROLE);
                InputSource is = new InputSource(source.getInputStream());
                is.setSystemId(source.getURI());
                doc = parser.parseDocument(is);
            } catch (SAXException se) {
                getLogger().error(source.getURI() + " is not a valid XML file");
            } catch (IOException ioe) {
                getLogger().error("Could not read file", ioe);
            } catch (ServiceException ce) {
View Full Code Here


        final Configuration m = config.getChild("managed-services", false);
        final List descriptors = new ArrayList();

        if (m != null) {
            SourceResolver resolver = null;
            DOMParser parser = null;

            try {
                final Configuration[] services = m.getChildren("descriptor");
                resolver = (SourceResolver) this.manager.lookup(SourceResolver.ROLE);
                parser = (DOMParser) this.manager.lookup(DOMParser.ROLE);

                for (int i = 0; i < services.length; ++i) {
                    final String location = services[i].getAttribute("src");
                    Source source = resolver.resolveURI(location);

                    final Document d =
                        parser.parseDocument(
                            new InputSource(
                                new InputStreamReader(source.getInputStream())
                            )
                        );
View Full Code Here

        }

        final Request req = ContextHelper.getRequest(this.context);
        AuthenticationResult result = null;
        if ( req.getRemoteUser() != null ) {
            DOMParser parser = null;
            try {
                parser = (DOMParser)this.manager.lookup(DOMParser.ROLE);
                final Document doc = parser.createDocument();
                final Element root = doc.createElement("authentication");
                doc.appendChild(root);
                this.fillContext(doc);

                result = new AuthenticationResult(true, doc);
View Full Code Here

    /* (non-Javadoc)
     * @see org.apache.cocoon.components.repository.Repository#getContentDOM(java.lang.String)
     */
    public Document getContentDOM(String uri) throws ProcessingException {

        DOMParser parser = null;

        try {
            parser = (DOMParser)this.manager.lookup( DOMParser.ROLE);
            return parser.parseDocument(new InputSource(this.getContentStream(uri)));

        } catch (SAXException se) {
            throw new ProcessingException ("Error parsing: " + this.repoBaseUrl + uri, se);
        } catch (IOException ioe) {
            throw new ProcessingException ("Error getting: " + this.repoBaseUrl + uri, ioe);
View Full Code Here

            }
        sendEndElementEvent(RESULT_ELEMENT);
    }

    private Document newDocument() throws SAXException, ServiceException {
        DOMParser parser = (DOMParser) this.manager.lookup(DOMParser.ROLE);
        try {
            return parser.createDocument();
        } finally {
            this.manager.release(parser);
        }
    }
View Full Code Here

        final List descriptors = new ArrayList();

        if (m != null)
        {
            SourceResolver resolver = null;
            DOMParser parser = null;

            try
            {
                final Configuration[] services = m.getChildren("descriptor");
                resolver = (SourceResolver) m_manager.lookup(SourceResolver.ROLE);
                parser = (DOMParser) m_manager.lookup(DOMParser.ROLE);

                for (int i = 0; i < services.length; ++i)
                {
                    final String location = services[i].getAttribute("src");
                    Source source = resolver.resolveURI(location);

                    final Document d =
                        parser.parseDocument(
                            new InputSource(
                                new InputStreamReader(source.getInputStream())
                            )
                        );
View Full Code Here

            }
        sendEndElementEvent(RESULT_ELEMENT);
    }

    private Document newDocument() throws SAXException, ServiceException {
        DOMParser parser = (DOMParser) this.manager.lookup(DOMParser.ROLE);
        try {
            return parser.createDocument();
        } finally {
            this.manager.release(parser);
        }
    }
View Full Code Here

     * @param doc org.w3c.dom.Document to save
     * @throws ProcessingException
     */
    private void saveDocumentToSource(Source docTarget, Document doc)
        throws ProcessingException {
        DOMParser parser = null;
        OutputStream os = null;
        String uri = docTarget.getURI();

        try {
            parser =
View Full Code Here

     * @param documentSrc
     * @throws ProcessingException
     */
    private Document loadDocumentFromSource(Source documentSrc)
        throws ProcessingException {
        DOMParser parser = null;
        try {
            parser =
                (DOMParser) this.serviceManager.lookup(DOMParser.ROLE);
            getLogger().debug(
                "request to load file " + documentSrc.getURI());
            InputSource input = new InputSource(documentSrc.getURI());
            return parser.parseDocument(input);
        } catch (Exception e) {
            throw new ProcessingException(
                "failed to load file to bind to: ",
                e);
        } finally {
View Full Code Here

        }

        final Request req = ContextHelper.getRequest(this.context);
        AuthenticationResult result = null;
        if ( req.getRemoteUser() != null ) {
            DOMParser parser = null;
            try {
                parser = (DOMParser)this.manager.lookup(DOMParser.ROLE);
                final Document doc = parser.createDocument();
                final Element root = doc.createElement("authentication");
                doc.appendChild(root);
                this.fillContext(doc);

                result = new AuthenticationResult(true, doc);
View Full Code Here

TOP

Related Classes of org.apache.excalibur.xml.dom.DOMParser

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.