Package org.zkoss.idom.input

Examples of org.zkoss.idom.input.SAXBuilder


  public void parse(URL url, Configuration config, Locator locator)
  throws Exception {
    if (url == null || config == null)
      throw new IllegalArgumentException("null");
    log.info("Parsing "+url);
    parse(new SAXBuilder(true, false, true).build(url).getRootElement(),
      config, locator);
  }
View Full Code Here


      for (Enumeration en = loc.getResources("metainfo/xel/config.xml");
      en.hasMoreElements();) {
        final URL url = (URL)en.nextElement();
        if (log.debugable()) log.debug("Loading "+url);
        try {
          final Document doc = new SAXBuilder(false, false, true).build(url);
          if (IDOMs.checkVersion(doc, url))
            parseConfig(doc.getRootElement(), loc);
        } catch (Exception ex) {
          log.error("Failed to parse "+url, ex); //keep running
        }
View Full Code Here

        throw DspException.Aide.wrap(ex);
     
    }
    private void loadTaglib0(String prefix, URL url)
    throws Exception {
      final Element root = new SAXBuilder(true, false, true)
        .build(url).getRootElement();
      _mapper.load(prefix, root);

      final Map acts = new HashMap();
      for (Iterator it = root.getElements("tag").iterator();
View Full Code Here

    return out != null ? out.toByteArray(): data;
  }

  /*package*/ Object parse(InputStream is, String path)
  throws Exception {
    final Element root = new SAXBuilder(true, false, true).build(is).getRootElement();
    final String name = IDOMs.getRequiredAttributeValue(root, "name");
    if (name.length() == 0)
      throw new UiException("The name attribute must be specified, "+root.getLocator()+", "+path);
    final boolean zk = "zk".equals(name),
      aaas = "zk.aaas".equals(name);
View Full Code Here

    response.getOutputStream().write(data);
    response.flushBuffer();
  }
  /*package*/ Object parse(InputStream is, String path)
  throws Exception {
    final Element root = new SAXBuilder(true, false, true).build(is).getRootElement();
    final String lang = IDOMs.getRequiredAttributeValue(root, "language");
    if (lang.length() == 0)
      throw new UiException("The language attribute must be specified, "+root.getLocator()+", "+path);

    final List items = new LinkedList();
View Full Code Here

    for (Enumeration en = locator.getResources("metainfo/zk/lang.xml");
    en.hasMoreElements();) {
      final URL url = (URL)en.nextElement();
      if (log.debugable()) log.debug("Loading "+url);
      try {
        final Document doc = new SAXBuilder(true, false, true).build(url);
        if (ConfigParser.checkVersion(url, doc, true))
          parseLang(doc, locator, url, false);
      } catch (Exception ex) {
        log.error("Failed to load "+url, ex);
        throw UiException.Aide.wrap(ex, "Failed to load "+url);
View Full Code Here

  /** Loads a language addon.
   */
  private static void loadAddon(Locator locator, URL url) {
    try {
      parseLang(
        new SAXBuilder(true, false, true).build(url), locator, url, true);
    } catch (Exception ex) {
      log.error("Failed to load addon: "+url, ex);
      //keep running
    }
  }
View Full Code Here

   * if not available.
   */
  public PageDefinition parse(File file, String path) throws Exception {
    //if (log.debugable()) log.debug("Parsing "+file);
    final PageDefinition pgdef =
      parse(new SAXBuilder(true, false, true).build(file),
        Servlets.getExtension(file.getName()));
    pgdef.setRequestPath(path);
    return pgdef;
  }
View Full Code Here

   * if not available.
   */
  public PageDefinition parse(URL url, String path) throws Exception {
    //if (log.debugable()) log.debug("Parsing "+url);
    final PageDefinition pgdef =
      parse(new SAXBuilder(true, false, true).build(url),
        Servlets.getExtension(url.toExternalForm()));
    pgdef.setRequestPath(path);
    return pgdef;
  }
View Full Code Here

   * the language called "xul/html" is assumed.
   */
  public PageDefinition parse(Reader reader, String extension)
  throws Exception {
    //if (log.debugable()) log.debug("Parsing "+reader);
    return parse(new SAXBuilder(true, false, true).build(reader), extension);
  }
View Full Code Here

TOP

Related Classes of org.zkoss.idom.input.SAXBuilder

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.