Examples of FuzzyXMLDocument


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;
    if ("html".equalsIgnoreCase(file.getFileExtension())) {
      try {
        doc = WodParserCache.parser(file).getHtmlEntry().getModel();
      }
      catch (Exception e) {
        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.FuzzyXMLDocument

                  }
                }
                _caches.push(nestedCache);
                _nodes.push(node);
                try {
                  FuzzyXMLDocument nestedDocument = nestedCache.getHtmlEntry().getModel();
                  if (nestedDocument != null) {
                    nestedDocument.getDocumentElement().toXMLString(renderContext, xmlBuffer);
                  }
                } finally {
                  _nodes.pop();
                  _caches.pop();
                }
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(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++){
                IFile incFile = basedir.getFile(new Path(((FuzzyXMLElement)includes[j]).getValue()));
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

    IDocument editDocument = documentProvider.getHtmlEditDocument();
    String documentContents = editDocument.get();

    try {
      WodParserCache cache = ((TemplateEditor) _editorInteraction.getHtmlDocumentProvider()).getSourceEditor().getParserCache();
      FuzzyXMLDocument htmlDocument = cache.getHtmlEntry().getModel();
      RenderContext renderContext = new RenderContext(true);
      renderContext.setDelegate(new PreviewRenderDelegate(cache));
      FuzzyXMLElement documentElement = htmlDocument.getDocumentElement();
      documentContents = documentElement.toXMLString(renderContext);
    } catch (Exception e) {
      e.printStackTrace();
    }
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(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.FuzzyXMLDocument

 
  public void selectionChangedToOffset(int offset) {
    TemplateSourceEditor sourceEditor = getSourceEditor();
    if (sourceEditor != null) {
      try {
        FuzzyXMLDocument xmlDocument = sourceEditor.getHtmlXmlDocument(true);
        if (xmlDocument != null) {
          FuzzyXMLElement selectedElement = xmlDocument.getElementByOffset(offset);
          if (selectedElement != null) {
            String tagName = selectedElement.getName();
            if (WodHtmlUtils.isWOTag(tagName)) {
              String woElementName = selectedElement.getAttributeValue("name");
              if (woElementName != null && woElementName.length() > 0) {
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

    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.FuzzyXMLDocument

    }
    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();
    HTMLHyperlinkInfo info = getOpenFileInfo(document, element, null, null, offset);
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

   * Returns ID attribute values.
   *
   * @return the array which contans ID attribute values
   */
  protected String[] getIDs() {
    FuzzyXMLDocument doc = getDocument();
    List<String> list = new ArrayList<String>();
    if (doc != null) {
      FuzzyXMLElement element = doc.getDocumentElement();
      extractID(element, list);
    }
    return list.toArray(new String[list.size()]);
  }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument

  protected void handleElementContentReplaced() {
    super.handleElementContentReplaced();
  }

  public FuzzyXMLDocument getHtmlXmlDocument(boolean refreshModel) throws Exception {
    FuzzyXMLDocument doc;
    if (refreshModel || isDirty()) {
      BuildProperties buildProperties = (BuildProperties)getParserCache().getProject().getAdapter(BuildProperties.class);
      FuzzyXMLParser parser = new FuzzyXMLParser(buildProperties != null ? buildProperties.isWellFormedTemplateRequired() : false, true);
      doc = parser.parse(getHTMLSource());
      getParserCache().getHtmlEntry().setModel(doc);
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.