Package jp.aonir.fuzzyxml

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser


  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()");
View Full Code Here


            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){
View Full Code Here

      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();
View Full Code Here

    String   prev = dim[1].toLowerCase();
    String   last = dim[2];
    String   attr = dim[3];
   
    this.offset = documentOffset;
    this.doc = new FuzzyXMLParser().parse(viewer.getDocument().get());
   
    List list    = new ArrayList();
    List tagList = getTagList();
   
    // attribute value
View Full Code Here

   
    // 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];
       
View Full Code Here

   */
  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

  protected boolean isHTML(){
    return true;
  }
 
  public void update(){
    this.doc = new FuzzyXMLParser(isHTML()).parse(editor.getHTMLSource());
    TreeViewer viewer = getTreeViewer();
    if(viewer!=null){
      viewer.refresh();
    }
  }
View Full Code Here

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

       
        this.contents = contents;
        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

        }
      }
     
      // getting TLDs from xmlns
      try {
        this.doc = new FuzzyXMLParser().parse(HTMLUtil.scriptlet2space(source,false));
        FuzzyXMLElement root = (FuzzyXMLElement)XPath.selectSingleNode(doc.getDocumentElement(),"*");
        if(root!=null){
          FuzzyXMLAttribute[] attrs = root.getAttributes();
          for(int i=0;i<attrs.length;i++){
            if(attrs[i].getName().startsWith("xmlns:")){
              String[] dim = attrs[i].getName().split(":");
              if(dim.length > 1){
                TLDInfo info = TLDInfo.getTLDInfo(file,dim[1],attrs[i].getValue());
                if(info!=null){
                  tldInfoList.add(info);
                }
              }
            }
          }
        }
      } catch(Exception ex){
        HTMLPlugin.logException(ex);
      }
     
      // getting TLDs from included JSP defined in web.xml
      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++){
View Full Code Here

TOP

Related Classes of jp.aonir.fuzzyxml.FuzzyXMLParser

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.