Examples of FuzzyXMLParser


Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

   * @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.FuzzyXMLParser

       
        this._contents = contents;
        this._contents = this._contents.replaceAll("\r\n"," \n");
        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

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

        e.printStackTrace();
        doc = null;
      }
    }
    else {
      doc = new FuzzyXMLParser(false).parse(source);
    }
    if (doc != null) {
      processElement(doc.getDocumentElement());
    }
  }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

    return true;
  }

  protected FuzzyXMLParser createParser(IProject project) {
    BuildProperties buildProperties = (BuildProperties)project.getAdapter(BuildProperties.class);
    FuzzyXMLParser parser = new FuzzyXMLParser(buildProperties != null ? buildProperties.isWellFormedTemplateRequired() : false, isHTML());
    return parser;
  }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

        }
      }
     
      // getting TLDs from xmlns
      try {
        this._doc = new FuzzyXMLParser(false).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 = null;
                String value = attrs[i].getValue();
                if(value.startsWith("urn:jsptagdir:")){
                  value = value.replaceFirst("^urn:jsptagdir:", "");
                  info = TLDInfo.getTLDInfoFromTagdir(file,dim[1],value);
                 
                } else if(value.startsWith("urn:jsptld:")){
                  value = value.replaceFirst("^urn:jsptld:", "");
                  info = TLDInfo.getTLDInfo(file,dim[1],value);
                 
                } else {
                  info = TLDInfo.getTLDInfo(file,dim[1],value);
                }
                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(false).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

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

   * @param jsp  JSP
   * @param info JSPInfo
   * @return processed JSP
   */
  private static String processTag(String jsp, JSPInfo info) {
    FuzzyXMLDocument doc = new FuzzyXMLParser(false).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.FuzzyXMLParser

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

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

    }
    return null;
  }

  private IHyperlink detectHyperlink(IDocument doc, int offset) {
    FuzzyXMLDocument document = new FuzzyXMLParser(false).parse(editor.getHTMLSource());
    FuzzyXMLElement element = document.getElementByOffset(offset);
    if (element == null) {
      return null;
    }
    FuzzyXMLAttribute[] attrs = element.getAttributes();
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

  protected boolean isHTML() {
    return true;
  }

  protected FuzzyXMLParser createParser() {
    FuzzyXMLParser parser = new FuzzyXMLParser(isHTML());
    return parser;
  }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

      e.printStackTrace();
    }
    String next = document.get().substring(documentOffset);

    this._offset = documentOffset;
    this._doc = new FuzzyXMLParser(false).parse(document.get());

    List<ICompletionProposal> list = new ArrayList<ICompletionProposal>();
    List<TagInfo> tagList = getTagList();

    // attribute value
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.