Examples of DocumentBuilderImpl


Examples of hu.jokeman.xparser.impl.document.DocumentBuilderImpl

        FileOutputStream fos = null;
       
        try {
            fis = new FileInputStream (args [0]);
            fos = new FileOutputStream (args [0] + ".html");
            DocumentBuilderImpl builder = new DocumentBuilderImpl ();
            builder.createDocument ();

            // input file feldologz�sa
            XMLProcessor processor = new XMLProcessor (builder);
            processor.process (fis);

            // dokumentumgy�k�r elk�r�se
            XMLDocument doc = builder.getDocument ();

            // white space takar�t�s
            WhiteSpaceNormalizer wsn = new WhiteSpaceNormalizer ();
            doc.accept (wsn);
View Full Code Here

Examples of net.sf.saxon.dom.DocumentBuilderImpl

    {
        try (InputStream books = IOUtils.getResourceAsStream("books.xml", getClass());
             InputStream cities = IOUtils.getResourceAsStream("cities.xml", getClass()))
        {

            DocumentBuilder documentBuilder = new DocumentBuilderImpl();
            Document booksDocument = documentBuilder.parse(books);
            Document citiesDocument = documentBuilder.parse(cities);

            // test both parameters as a document or as a node
            assertMultipleInputs("multipleInputsByParam", booksDocument, citiesDocument.getFirstChild());
        }
    }
View Full Code Here

Examples of net.sf.saxon.dom.DocumentBuilderImpl

    }

    public void processLog(File logdir,
                          String path) throws Exception {

        DocumentBuilderImpl DB;
        DB = new DocumentBuilderImpl();

        DocumentBuilder db3 = DocumentBuilderFactory.newInstance()
                      .newDocumentBuilder();
        Document owner = db3.newDocument();
View Full Code Here

Examples of org.lobobrowser.html.parser.DocumentBuilderImpl

        String actualURI = urlForLoading.toExternalForm();
        // Note that DocumentBuilderImpl needs to be
        // constructed by passing both a UserAgentContext
        // and an HtmlRendererContext in this case, so
        // that form.submit() can take effect.
        DocumentBuilderImpl builder = new DocumentBuilderImpl(this.uacontext, this);
        String charset = org.lobobrowser.util.Urls.getCharset(connection);
        InputSourceImpl is = new InputSourceImpl(bin, actualURI, charset);
        this.document = (HTMLDocumentImpl) builder.parse(is);
      } finally {
        in.close();
      }
    } catch(Exception err) {
      this.document = null;
View Full Code Here

Examples of org.lobobrowser.html.parser.DocumentBuilderImpl

          String actualURI = urlForLoading.toExternalForm();
          // Note that DocumentBuilderImpl needs to be
          // constructed by passing both a UserAgentContext
          // and an HtmlRendererContext in this case, so
          // that form.submit() can take effect.
          DocumentBuilderImpl builder = new DocumentBuilderImpl(this.uacontext, this);
          String charset = org.lobobrowser.util.Urls.getCharset(connection);
          InputSourceImpl is = new InputSourceImpl(bin, actualURI, charset);
          this.document = (HTMLDocumentImpl) builder.parse(is);
        } finally {
          in.close();
        }
      } catch(Exception err) {
        this.document = null;
View Full Code Here

Examples of org.lobobrowser.html.parser.DocumentBuilderImpl

    UserAgentContext ucontextMessage = new SimpleUserAgentContext();
    HtmlRendererContext rcontextMessage = new MWHtmlRendererContext(
        textMessage, ucontextMessage);
    textMessage.setPreferredSize(new Dimension(500, 150));
    textMessage.setMinimumSize(new Dimension(100, 100));
    DocumentBuilderImpl dbi = new DocumentBuilderImpl(
        ucontextMessage, rcontextMessage);
    InputSource is = new InputSource(new StringReader(Version.MESSAGE));
    is.setSystemId(EnumWikipedia.EN.getConfiguration().getString(WPCConfigurationString.HELP_URL));
    try {
      textMessage.setDocument(dbi.parse(is), rcontextMessage);
    } catch (SAXException e) {
      // Nothing
    } catch (IOException e) {
      // Nothing
    }
View Full Code Here

Examples of org.lobobrowser.html.parser.DocumentBuilderImpl

    }
    // Display description
    if ((algorithm != null) && (description != null)) {
      // Error type description
      try {
        DocumentBuilderImpl dbi = new DocumentBuilderImpl(ucontext, rcontextDescription);
        InputSource is = new InputSource(new StringReader(description));
        CheckWiki cw = APIFactory.getCheckWiki();
        is.setSystemId(cw.getUrlDescription(getWikipedia(), algorithm));
        Document document = dbi.parse(is);
        textDescription.setDocument(document, rcontextDescription);
      } catch (SAXException e) {
        textDescription.clearDocument();
      } catch (IOException e) {
        textDescription.clearDocument();
      }

      // Parameters description
      try {
        Configuration config = Configuration.getConfiguration();
        boolean secured = config.getBoolean(null, ConfigurationValueBoolean.SECURE_URL);
        EnumWikipedia wiki = getWikipedia();
        String translationPage = wiki.getConfiguration().getString(
            WPCConfigurationString.CW_TRANSLATION_PAGE);
        String url = wiki.getSettings().getURL(translationPage, true, secured);
        StringBuilder parametersDescription = new StringBuilder();
        parametersDescription.append(GT._(
            "The error n°{0} can be configured with the following parameters in the <a href=\"{1}\">translation file</a> :",
            new Object[] { Integer.toString(errorNumber), url }));
        parametersDescription.append("\n<ul>");
        Map<String, String> parameters = algorithm.getParameters();
        for (Map.Entry<String, String> entry : parameters.entrySet()) {
          parametersDescription.append("<li><b>");
          parametersDescription.append(entry.getKey());
          parametersDescription.append("</b>: ");
          parametersDescription.append(entry.getValue());
          parametersDescription.append("</li>\n");
        }
        parametersDescription.append("</ul>");
        DocumentBuilderImpl dbi = new DocumentBuilderImpl(ucontext, rcontextParameters);
        InputSource is = new InputSource(new StringReader(parametersDescription.toString()));
        is.setSystemId(url);
        Document document = dbi.parse(is);
        textParameters.setDocument(document, rcontextParameters);
      } catch (SAXException e) {
        textParameters.clearDocument();
      } catch (IOException e) {
        textParameters.clearDocument();
View Full Code Here

Examples of org.lobobrowser.html.parser.DocumentBuilderImpl

  /* (non-Javadoc)
   * @see org.wikipediacleaner.gui.swing.worker.HtmlPreview#setHtml(java.lang.String)
   */
  public void setHtml(String text) {
    try {
      DocumentBuilderImpl dbi = new DocumentBuilderImpl(ucontext, rcontext);
      InputSource is = new InputSource(new StringReader(text));
      is.setSystemId(getWikipedia().getSettings().getURL(textTitle.getText(), true, false));
      Document document = dbi.parse(is);
      htmlPreview.setDocument(document, rcontext);
    } catch (SAXException e) {
      htmlPreview.clearDocument();
    } catch (IOException e) {
      htmlPreview.clearDocument();
View Full Code Here

Examples of org.lobobrowser.html.parser.DocumentBuilderImpl

   */
  void updateInformation() {
    try {
      lblTitle.setText(title);
      if (html) {
        DocumentBuilderImpl dbi = new DocumentBuilderImpl(
            ucontextInformation, rcontextInformation);
        InputSource is = new InputSource(new StringReader(information));
        is.setSystemId("http://localhost");
        textInformation.setDocument(dbi.parse(is), rcontextInformation);
      } else {
        textPane.setText(information);
      }
    } catch (SAXException e) {
      // Nothing
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.