Package net.sf.toxicity.util

Examples of net.sf.toxicity.util.NamespaceContext


            boolean optional = bind.optional();
           
            try {
                // make ns available
                if(!bind.nsUri().equals("")) {
                    NamespaceContext nsContext = new NamespaceContext();
                    nsContext.addPrefix(bind.nsUri(), bind.nsPrefix());
                    xpath.setNamespaceContext(nsContext);
                }
               
                // check if condition applies before evaluation xpath
                if(!cond.equals("")) {
View Full Code Here


    public XPathSelectionPipeline(String pExpression, String pUri, String pPrefix) {
       
        XPath xpath = XmlUtil.newXPath();
       
        if(pUri != null && pPrefix != null) {
            NamespaceContext namespaceContext = new NamespaceContext();
            namespaceContext.addPrefix(pUri, pPrefix);
            xpath.setNamespaceContext(namespaceContext);
        }
       
        try {
            mXPathExpression = xpath.compile(pExpression);
View Full Code Here

            mCopyTransformer = XmlUtil.getTransformerFactory().newTransformer();
            mCopyTransformer.setOutputProperty(OutputKeys.METHOD, "xml");
            mCopyTransformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
            mCopyTransformer.setOutputProperty(OutputKeys.INDENT, "yes");
            XPath xpath = XmlUtil.newXPath();
            NamespaceContext ns = new NamespaceContext("http://www.w3.org/1999/xhtml", "xhtml");
            xpath.setNamespaceContext(ns);
            mContentTypeJsonResponsePath = xpath.compile("/json-response");
        } catch (TransformerConfigurationException e) {
            log.error(e.getMessage(), e);
        } catch (XPathExpressionException e) {
View Full Code Here

       
        //
        // increase count on selected item (if any)
        //
        XPath xpath = XmlUtil.newXPath();
        xpath.setNamespaceContext(new NamespaceContext("http://toxicity.sf.net/ns/examples/nuke/poll", "p"));
        if(mSelectedPollItem != null) {
            Element pollItem = pollDoc.getElementById(mSelectedPollItem);
            try {
                pollItem = (Element) xpath.evaluate("/p:poll-collection/p:poll/p:item[@id='" + mSelectedPollItem + "']",
                        pollDoc, XPathConstants.NODE);
View Full Code Here

TOP

Related Classes of net.sf.toxicity.util.NamespaceContext

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.