Package org.jdom2.input

Examples of org.jdom2.input.StAXStreamBuilder.build()


   */
  public static List< Element > parse( InputStream xmlStream, String requestedNodes ) {
    if( xmlStream != null && StringUtils.isNotEmpty( requestedNodes ) ) {
      SAXBuilder builder = new SAXBuilder();
      try {
                Document doc = builder.build( xmlStream );
                XPathFactory xpfac = XPathFactory.instance();
                XPathExpression< Element > xp = xpfac.compile( requestedNodes, Filters.element() );
               
        return xp.evaluate( doc );
      } catch ( IOException ioe ) {
View Full Code Here


        }
        if( url == null )
            throw new IOException("Unable to find web.xml for processing.");

        log.debug( "Processing web.xml at " + url.toExternalForm() );
        doc = builder.build( url );
        return doc;
    }

    /**
     * <p>XML entity resolver that redirects resolution requests by JDOM, JAXP and
View Full Code Here

          String versionOverride = System.getProperty("version.override");
            if (versionOverride != null) {
                getLog().info("changing version of pom file and save it to target/pom.xml");
                SAXBuilder builder = new SAXBuilder();
                Document doc = builder.build(pomFile);
                Element versionElem = findElement(doc.getRootElement().getChildren(), "version");
                if (versionElem == null) {
                 
                  //version inherited from parent, so get it from there
                  Element parentElem = findElement(doc.getRootElement().getChildren(), "parent");
View Full Code Here

  public Element importarArquivoXML(){
    Document doc = null;
        SAXBuilder builder = new SAXBuilder();
        try {

              doc = builder.build(path);

        } catch (Exception e) {
         
              e.printStackTrace();
View Full Code Here

           
            httpclient.executeMethod(get);
           
            final String xml = get.getResponseBodyAsString();
            final SAXBuilder builder = new SAXBuilder();
            Document doc = builder.build(new StringReader(xml));
            Element root = doc.getRootElement();
            String lat = root.getChild("result").getChild("geometry").getChild("location").getChildTextTrim("lat");
            String lon = root.getChild("result").getChild("geometry").getChild("location").getChildTextTrim("lng");
            return Location.fromString(lat + ";" + lon);
        } catch (Exception ex) {
View Full Code Here

                String cleanScmUrl = "not defined";
                try
                {
                    String content = ReleaseUtil.readXmlFile(pomFile, ls);
                    SAXBuilder builder = new SAXBuilder();
                    Document document = builder.build(new StringReader( content ));
                    Element root = document.getRootElement();

                    Element scmElement = root.getChild("scm", getNamespaceOrNull(root));

                    if(null != scmElement)
View Full Code Here

                File file = new File(filename);
                if(!file.exists())
                {
                    throw new FileNotFoundException(filename);
                }
                Element root = builder.build(file).getRootElement();
                int player_id = getPlayerId(root,player);
                role = getRole(root,player_id);
                for(Element e : root.getChild("history").getChildren("step"))
                {
                    String s = e.getChildren("step-number").get(0).getText();
View Full Code Here

                if(!file.exists())
                {
                    break;
                }
               
                Element root = builder.build(file).getRootElement();
                List<Element> states = root.getChildren("state");
                SerializableState state = getState(states.get(0));
                SerializableAction action = actions.get(step);
                if(action != null)
                {
View Full Code Here

                String cleanScmUrl = "not defined";
                try
                {
                    String content = ReleaseUtil.readXmlFile(pomFile, ls);
                    SAXBuilder builder = new SAXBuilder();
                    Document document = builder.build(new StringReader( content ));
                    Element root = document.getRootElement();

                    Element scmElement = root.getChild("scm", getNamespaceOrNull(root));

                    if(null != scmElement)
View Full Code Here

    SAXBuilder builder = new SAXBuilder();
    String imsFNm = IMAGE_DIR + fnm;
    logger.info("Reading file: " + imsFNm);
    InputStream in = this.getClass().getResourceAsStream(imsFNm);
    try {
      Document document = builder.build(in);
      Element rootNode = document.getRootElement(); // images
      List<Element> imageList = rootNode.getChildren("image");
      for (Element image : imageList) {
        String name = image.getAttributeValue("name");
        ECrop crop;
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.