Package org.jdom2.input

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


    // Manually construct illegal XML and make sure the outputter notices
    @Test
    public void test_ErrorSurrogatePairOutput() throws JDOMException, IOException {
      SAXBuilder builder = new SAXBuilder();
      builder.setExpandEntities(true);
      Document doc = builder.build(new StringReader("<?xml version=\"1.0\"?><root></root>"));
      Text t = new UncheckedJDOMFactory().text("\uD800\uDBFF");
      doc.getRootElement().setContent(t);
      Format format = Format.getCompactFormat().setEncoding("ISO-8859-1");
      XMLOutputter outputter = new XMLOutputter(format);
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
View Full Code Here


    /* Load the map. This is called in the main class upon game start */
    public void load(File loadFile) {
        try {
            SAXBuilder builder = new SAXBuilder();
            Document document = builder.build(loadFile);
            Element root = document.getRootElement();

            for (Element tile : root.getChildren()) {
                int x = (int) Double.parseDouble(tile.getAttributeValue("x"));
                int y = (int) Double.parseDouble(tile.getAttributeValue("y"));
View Full Code Here

  private static final String PLAYER = "player";
 
  public static Tree<String> buildDemoPokerTree() throws JDOMException, IOException {
    NodeMetaInfo<String> root = null;
    SAXBuilder parser = new SAXBuilder();
    Document doc = parser.build("/home/m1/programming/java/jPokerTreeView/data/large_tree.xml");
    Element data = doc.getRootElement().getChildren().get(0);
    root = convert(data);
    root.setChildren(convert(data.getChildren()));
   
    Tree<String> tree = new Tree<String>(root);
View Full Code Here

  }
 
  public static Tree<String> buildPokerTree(String filePath) throws JDOMException, IOException{
    NodeMetaInfo<String> root = null;
    SAXBuilder parser = new SAXBuilder();
    Document doc = parser.build(filePath);
    Element data = doc.getRootElement().getChildren().get(0);
    root = convert(data);
    root.setChildren(convert(data.getChildren()));
   
    Tree<String> tree = new Tree<String>(root);
View Full Code Here

  }
 
  public static Tree<String> buildDemoPokerSmallTree() throws JDOMException, IOException {
    NodeMetaInfo<String> root = null;
    SAXBuilder parser = new SAXBuilder();
    Document doc = parser.build("/home/m1/programming/java/jPokerTreeView/data/simple_tree.xml");
    Element data = doc.getRootElement().getChildren().get(0);
    root = convert(data);
    root.setChildren(convert(data.getChildren()));
    Tree<String> tree = new Tree<String>(root);
    return tree;
View Full Code Here

        report(0.0, "Loading options file");

        SAXBuilder builder = new SAXBuilder();
        Element rootElement;
        try {
            rootElement = builder.build(optionsFile).getRootElement();
        } catch (JDOMException e) {
            throw new IOException(e);
        }

        OptionsExtractor extractor = new OptionsExtractor();
View Full Code Here

        report(0.0, "Loading options file");

        SAXBuilder builder = new SAXBuilder();
        Element rootElement;
        try {
            rootElement = builder.build(optionsFile).getRootElement();
        } catch (JDOMException e) {
            throw new IOException(e);
        }

        OptionsExtractor extractor = new OptionsExtractor();
View Full Code Here

    protected JDOM(String path) {
        this.path = path;
        SAXBuilder sxb = new SAXBuilder();
        try {
            doc = sxb.build(new File(path));
            rootNode = doc.getRootElement();
        } catch (JDOMException ex) {
            doc = new Document(); // Permet lorsque le fichier vient d etre crée
            //Logger.getLogger(JDOM.class.getName()).log(Level.SEVERE, null, ex);
        } catch (IOException 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

    if (messageFormatIS == null) {
      logger.debug("file messageformat.xml not found in classpath");
    } else {
      try {
        SAXBuilder builder = new SAXBuilder();
        Document document = builder.build(messageFormatIS);

        messageFormatIS.close();

        Element rootElement = document.getRootElement();
        List<Element> markers = rootElement.getChildren("marker");
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.