Package org.polyglotted.xpathstax.api

Examples of org.polyglotted.xpathstax.api.NodeHandler


        XmlAttribute attribute = XmlAttribute.from(xmlr);

        List<NodeHandler> handlers = Lists.newArrayList();
        for (Entry<XPathRequest, NodeHandler> entry : handlersMap.entrySet()) {
            if (entry.getKey().canProcess(curElement, attribute, context)) {
                NodeHandler handler = entry.getValue();
                handler.elementStart(getName(xmlr));
                handlers.add(handler);
            }
        }

        context.addHandlers(curElement, attribute, handlers);
View Full Code Here


public class XPathStaxParserTest {

    @Test
    public void testParse() {
        XPathStaxParser parser = new XPathStaxParser();
        parser.addHandler(new XPathRequest("/catalog/book[@id='bk101']/price"), new NodeHandler() {
            @Override
            public void processNode(XmlNode xmlNode) {
                Value count = xmlNode.getText();
                assertEquals(44.95, count.asDouble(), 0.001);            }
View Full Code Here

TOP

Related Classes of org.polyglotted.xpathstax.api.NodeHandler

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.