⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stylesheetfilter.java

📁 随书的代码
💻 JAVA
字号:
import org.jdom.filter.Filter;import org.jdom.*;import java.util.List;public class StylesheetFilter implements Filter {  // This filter is read-only. Nothing can be added or removed.  public boolean canAdd(Object o) {    return false;   }    public boolean canRemove(Object o) {    return false;    }    public boolean matches(Object o) {       if (o instanceof ProcessingInstruction) {      ProcessingInstruction pi = (ProcessingInstruction) o;       if (pi.getTarget().equals("xml-stylesheet")) {        // Test to see if we're outside the root element        if (pi.getParent() == null) {          Document doc = pi.getDocument();          Element root = doc.getRootElement();          List content = doc.getContent();          if (content.indexOf(pi) < content.indexOf(root)) {            // In prolog            return true;          }        }      }    }    return false;     }    }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -