Examples of FuzzyXMLParser


Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

  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);
      setCacheOutOfSync(false);
    }
    else {
      doc = getParserCache().getHtmlEntry().getModel();
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

 
  /**
   * Extracts the first element name in the given xml source.
   */
  private static String getFirstTag(String xml){
    FuzzyXMLDocument doc = new FuzzyXMLParser(false).parse(xml);
    FuzzyXMLNode[] nodes = doc.getDocumentElement().getChildren();
    for(int i=0;i<nodes.length;i++){
      if(nodes[i] instanceof FuzzyXMLElement){
        return ((FuzzyXMLElement)nodes[i]).getName();
      }
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

    // �I�t�Z�b�g���擾�����炷���폜
    removeChild(test);

    String parseText = "<root>" + text + "</root>";

    FuzzyXMLElement root = new FuzzyXMLParser(wo54).parse(parseText).getDocumentElement();
    ((AbstractFuzzyXMLNode) root).appendOffset(root, 0, -6);
    ((AbstractFuzzyXMLNode) root).appendOffset(root, 0, offset);
    FuzzyXMLNode[] nodes = ((FuzzyXMLElement) root.getChildren()[0]).getChildren();

    appendOffset(this, offset, text.length());
View Full Code Here

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

    @Override
    public void run(){
      try {
        IDocument xmlDocument = getDocumentProvider().getDocument(getEditorInput());
        String xmlString = xmlDocument.get();
        FuzzyXMLDocument htmlModel = new FuzzyXMLParser(false, false).parse(xmlString);
        FuzzyXMLElement documentElement = htmlModel.getDocumentElement();

        IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
        RenderContext renderContext = new RenderContext(true);
        renderContext.setShowNewlines(true);
View Full Code Here

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(false).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

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

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

Examples of jp.aonir.fuzzyxml.FuzzyXMLParser

  }

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