Package jp.aonir.fuzzyxml

Examples of jp.aonir.fuzzyxml.FuzzyXMLDocument


    return (byte[])JarAcceptor.accept(basedir, new IJarVisitor(){
      public Object visit(JarFile file, JarEntry entry) throws Exception {
        if(entry.getName().endsWith(".tld")){
          byte[] bytes = HTMLUtil.readStream(file.getInputStream(entry));
          try {
            FuzzyXMLDocument doc = new FuzzyXMLParser(false).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


    _buildProperties = buildProperties;
  }

  public void run(IProgressMonitor monitor) throws InvocationTargetException {
    try {
      FuzzyXMLDocument htmlModel = _cache.getHtmlEntry().getModel();
      FuzzyXMLElement element = htmlModel.getElementByOffset(_offset);
      if (element != null) {
        IWodModel wodModel = _cache.getWodEntry().getModel();
        String tagName = element.getName();
        if (WodHtmlUtils.isInline(tagName)) {
          SimpleWodElement wodElement = new FuzzyXMLWodElement(element, _buildProperties);
View Full Code Here

      Position typePosition = _element.getElementTypePosition();
      if (_element.isInline()) {
        IDocument htmlDocument = _cache.getHtmlEntry().getDocument();
        if (htmlDocument != null) {
          List<TextEdit> htmlEdits = new LinkedList<TextEdit>();
          FuzzyXMLDocument xmlDocument = _cache.getHtmlEntry().getModel();
          if (xmlDocument != null) {
            FuzzyXMLElement xmlElement = xmlDocument.getElementByOffset(typePosition.getOffset());
            if (xmlElement != null && xmlElement.hasCloseTag()) {
              htmlEdits.add(new ReplaceEdit(xmlElement.getCloseTagOffset() + xmlElement.getCloseNameOffset() + 1, xmlElement.getCloseNameLength(), "wo:" + _newType));
            }
          }
          htmlEdits.add(new ReplaceEdit(typePosition.getOffset(), typePosition.getLength(), _newType));
View Full Code Here

  @Override
  public void validate() throws Exception {
    setValidated(true);
    IFile htmlFile = getFile();
    FuzzyXMLDocument htmlXmlDocument = _getModel();
    if (htmlXmlDocument != null && (htmlFile == null || htmlFile.exists())) {
      String htmlErrorsSeverity = Activator.getDefault().getPluginPreferences().getString(PreferenceConstants.HTML_ERRORS_SEVERITY_KEY);
      if (!PreferenceConstants.IGNORE.equals(htmlErrorsSeverity)) {
        if (htmlFile != null && htmlFile.exists()) {
          for (HtmlProblem problem : getParserProblems()) {
View Full Code Here

  @Override
  protected FuzzyXMLDocument _parse(String contents) {
    BuildProperties buildProperties = (BuildProperties)getCache().getProject().getAdapter(BuildProperties.class);
    FuzzyXMLParser parser = new FuzzyXMLParser(buildProperties != null ? buildProperties.isWellFormedTemplateRequired() : false, true);
    parser.addErrorListener(this);
    FuzzyXMLDocument htmlXmlDocument = parser.parse(contents);
    return htmlXmlDocument;
  }
View Full Code Here

TOP

Related Classes of jp.aonir.fuzzyxml.FuzzyXMLDocument

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.