Examples of FuzzyXMLDocument


Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

  private static byte[] getTLDFromWebXML(File basedir,String uri){
    File webXML = new File(basedir,"/WEB-INF/web.xml");
   
    if(webXML.exists() && webXML.isFile()){
      try {
        FuzzyXMLDocument doc = new FuzzyXMLParser().parse(new FileInputStream(webXML));
        FuzzyXMLNode[] nodes = XPath.selectNodes(doc.getDocumentElement(),"/web-app/taglib|/web-app/jsp-config/taglib");
       
        for(int i=0;i<nodes.length;i++){
          FuzzyXMLElement element = (FuzzyXMLElement)nodes[i];
          String taglibUri = HTMLUtil.getXPathValue(element,"/taglib-uri/child::text()");
          String taglibLoc = HTMLUtil.getXPathValue(element,"/taglib-location/child::text()");
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

            while(e.hasMoreElements()){
              JarEntry entry = (JarEntry)e.nextElement();
              if(entry.getName().endsWith(".tld")){
                byte[] bytes = HTMLUtil.readStream(jarFile.getInputStream(entry));
                try {
                  FuzzyXMLDocument doc = new FuzzyXMLParser().parse(new ByteArrayInputStream(bytes));
                  String nodeURI = HTMLUtil.getXPathValue(doc.getDocumentElement(),"/taglib/uri/child::text()");
                  if(nodeURI!=null && uri.equals(nodeURI)){
                    return bytes;
                  }
                } catch(Exception ex){
                  HTMLPlugin.logException(ex);
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

      cursor= new Cursor(display, SWT.CURSOR_HAND);
    text.setCursor(cursor);
  }
 
  private IRegion selectWord(IDocument doc,int offset){
    FuzzyXMLDocument document = new FuzzyXMLParser().parse(editor.getHTMLSource());
    FuzzyXMLElement element = document.getElementByOffset(offset);
    if(element==null){
      return null;
    }
    FuzzyXMLAttribute[] attrs = element.getAttributes();
    for(int i=0;i<attrs.length;i++){
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

   
    // apply configuration (too long!!)
    IPreferenceStore store = HTMLPlugin.getDefault().getPreferenceStore();
    String xml = store.getString(HTMLPlugin.PREF_PALETTE_ITEMS);
    if(xml!=null){
      FuzzyXMLDocument doc = new FuzzyXMLParser().parse(xml);
      // apply visible
      FuzzyXMLNode[] groups = HTMLUtil.selectXPathNodes(doc.getDocumentElement(),"/palette/groups/group");
      for(int i=0;i<groups.length;i++){
        FuzzyXMLElement group = (FuzzyXMLElement)groups[i];
       
        String name = group.getAttributeNode("name").getValue();
        boolean visible = new Boolean(group.getAttributeNode("visible").getValue()).booleanValue();
       
        List entries = viewer.getPaletteRoot().getChildren();
        PaletteDrawer drawer = null;
       
        for(int j=0;j<entries.size();j++){
          drawer = (PaletteDrawer)entries.get(j);
          if(drawer.getLabel().equals(name)){
            drawer.setVisible(visible);
            break;
          } else {
            drawer =null;
          }
        }
        if(drawer==null){
          drawer = new PaletteDrawer(name);
          drawer.setVisible(visible);
          viewer.getPaletteRoot().add(drawer);
        }
      }
      // add user items
      FuzzyXMLNode[] items = HTMLUtil.selectXPathNodes(doc.getDocumentElement(),"/palette/items/item");
      String[] categories = getCategories();
      for(int i=0;i<items.length;i++){
        FuzzyXMLElement item = (FuzzyXMLElement)items[i];
        String name  = item.getAttributeNode("name").getValue();
        String group = item.getAttributeNode("group").getValue();
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

   */
  public void reload(IFile file,String source){
    this.file = file;
    rules.clear();
    source = HTMLUtil.scriptlet2space(source,false);
    FuzzyXMLDocument doc = new FuzzyXMLParser().parse(source);
    if(doc!=null){
      processElement(doc.getDocumentElement());
    }
  }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

    addSupportedExtension("jspf");
    addSupportedExtension("jspx");
  }
 
  public void doDetect() throws Exception {
    FuzzyXMLDocument doc = new FuzzyXMLParser().parse(this.contents);
    processElement(doc.getDocumentElement());
  }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

        this.contents = this.contents.replaceAll("\r\n"," \n");
        this.contents = this.contents.replaceAll("\r"  ,"\n");
       
        FuzzyXMLParser parser = new FuzzyXMLParser();
//        parser.addErrorListener(new HTMLParseErrorListener());
        FuzzyXMLDocument doc = parser.parse(contents);
        validateDocument(doc);
      }
    } catch(Exception ex){
      HTMLPlugin.logException(ex);
    }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

      try {
        if(include){
          IPath path = new Path(webapproot).append("/WEB-INF/web.xml");
          IFile webXML = file.getProject().getFile(path);
          if(webXML!=null && webXML.exists()){
            FuzzyXMLDocument doc = new FuzzyXMLParser().parse(webXML.getContents());
            FuzzyXMLNode[] nodes = HTMLUtil.selectXPathNodes(doc.getDocumentElement(),
              "/web-app/jsp-config/jsp-property-group[url-pattern='*.jsp']");
            for(int i=0;i<nodes.length;i++){
              FuzzyXMLNode[] includes = HTMLUtil.selectXPathNodes((FuzzyXMLElement)nodes[i],"/include-prelude|/include-coda");
              for(int j=0;j<includes.length;j++){
                IFile incFile = basedir.getFile(new Path(((FuzzyXMLElement)includes[j]).getValue()));
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

   * @param jsp  JSP
   * @param info JSPInfo
   * @return processed JSP
   */
  private static String processTag(String jsp,JSPInfo info){
    FuzzyXMLDocument doc = new FuzzyXMLParser().parse(jsp);
    FuzzyXMLNode[] nodes = doc.getDocumentElement().getChildren();
    StringBuffer sb = new StringBuffer();
    for(int i=0;i<nodes.length;i++){
      if(nodes[i] instanceof FuzzyXMLElement){
        sb.append(processElement((FuzzyXMLElement)nodes[i],info));
      }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

        this._contents = this._contents.replaceAll("\r"  ,"\n");
       
        FuzzyXMLParser parser = new FuzzyXMLParser(false);
        parser.addErrorListener( this);
//        parser.addErrorListener(new HTMLParseErrorListener());
        FuzzyXMLDocument doc = parser.parse(contents);
        validateDocument(doc);
      }
    } catch(Exception ex){
      HTMLPlugin.logException(ex);
    }
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.