< prev index next >

test/javax/xml/jaxp/unittest/transform/Bug6559595.java

Print this page




  53     public void test() {
  54         try {
  55             String xml = "<html><body><a href='http://example.com/bla?x&amp;y'>" + "</a></body></html>";
  56 
  57             Source src = new StreamSource(new StringReader(xml));
  58             StringWriter stringWriter = new StringWriter();
  59             Result res = new StreamResult(stringWriter);
  60             TransformerFactory tf = TransformerFactory.newInstance();
  61             Transformer t = tf.newTransformer();
  62             t.setOutputProperty(OutputKeys.METHOD, "html");
  63             t.transform(src, res);
  64 
  65             // System.out.println("s = " + stringWriter.toString());
  66             Assert.assertTrue(stringWriter.toString().contains("&amp;"));
  67         } catch (Exception e) {
  68             Assert.fail(e.getMessage());
  69         }
  70     }
  71 
  72 }
  73 


  53     public void test() {
  54         try {
  55             String xml = "<html><body><a href='http://example.com/bla?x&amp;y'>" + "</a></body></html>";
  56 
  57             Source src = new StreamSource(new StringReader(xml));
  58             StringWriter stringWriter = new StringWriter();
  59             Result res = new StreamResult(stringWriter);
  60             TransformerFactory tf = TransformerFactory.newInstance();
  61             Transformer t = tf.newTransformer();
  62             t.setOutputProperty(OutputKeys.METHOD, "html");
  63             t.transform(src, res);
  64 
  65             // System.out.println("s = " + stringWriter.toString());
  66             Assert.assertTrue(stringWriter.toString().contains("&amp;"));
  67         } catch (Exception e) {
  68             Assert.fail(e.getMessage());
  69         }
  70     }
  71 
  72 }

< prev index next >