Package org.zkoss.idom

Examples of org.zkoss.idom.ProcessingInstruction


    String lang = null;
    for (Iterator it = doc.getChildren().iterator(); it.hasNext();) {
      final Object o = it.next();
      if (!(o instanceof ProcessingInstruction)) continue;

      final ProcessingInstruction pi = (ProcessingInstruction)o;
      final String target = pi.getTarget();
      if ("page".equals(target)) {
        //we handle only the language attribute here
        final Map params = pi.parseData();
        final String l = (String)params.remove("language");
        if (l != null) {
          noEL("language", l, pi);
          lang = l;
        }

        if (!params.isEmpty())
          pis.add(pi); //process it later
      } else if ("import".equals(target)) { //import
        final Map params = pi.parseData();
        final String src = (String)params.remove("src");
        final String dirs = (String)params.remove("directives");
        if (!params.isEmpty())
          log.warning("Ignored unknown attributes: "+params.keySet()+", "+pi.getLocator());
        noELnorEmpty("src", src, pi);
        noEL("directives", dirs, pi);
        imports.add(new String[] {src, dirs});
      } else {
        pis.add(pi);
View Full Code Here


    for (Iterator it = doc.getChildren().iterator(); it.hasNext();) {
      final Object o = it.next();
      if (!(o instanceof ProcessingInstruction))
        continue;

      final ProcessingInstruction pi = (ProcessingInstruction)o;
      final String target = pi.getTarget();
      final Map params = pi.parseData();
      if ("taglib".equals(target)) {
        final String uri = (String)params.remove("uri");
        final String prefix = (String)params.remove("prefix");
        if (!params.isEmpty())
          log.warning("Ignored unknown attribute: "+params+", "+pi.getLocator());
        if (uri == null || prefix == null)
          throw new UiException("Both uri and prefix attribute are required, "+pi.getLocator());
        if (log.debugable()) log.debug("taglib: prefix="+prefix+" uri="+uri);
        langdef.addTaglib(new Taglib(prefix, uri));
      } else {
        log.warning("Unknown processing instruction: "+target);
      }
View Full Code Here

TOP

Related Classes of org.zkoss.idom.ProcessingInstruction

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.