Example #1
0
  public void setDocument(URL docUrl, URL ssURL)
      throws IOException, ParserConfigurationException, SAXException {

    StyleSheetReader ssReader = new StyleSheetReader();
    final StyleSheet ss = ssReader.read(ssURL);

    DocumentReader reader = new DocumentReader();

    reader.setWhitespacePolicyFactory(
        new IWhitespacePolicyFactory() {
          public IWhitespacePolicy getPolicy(String publicId) {
            return new CssWhitespacePolicy(ss);
          }
        });

    VEXDocument doc = reader.read(docUrl);
    this.setDocument(doc, ss);
  }
Example #2
0
 public void setStyleSheet(URL ssUrl) throws IOException {
   StyleSheetReader reader = new StyleSheetReader();
   StyleSheet ss = reader.read(ssUrl);
   this.setStyleSheet(ss);
 }