Esempio n. 1
0
 /** @param eNewParent */
 public static void debugOutput(Element eNewParent) {
   try {
     Document d = XML.newDocument("test");
     d.getDocumentElement().appendChild(d.importNode(eNewParent, true));
     System.err.println(XML.saveString(d).replaceAll("(^(.|[\\n\\r])*<test>)|(</test>$)", ""));
   } catch (Exception e) {
   }
 }
Esempio n. 2
0
 private void addText(StyleContext sc, String xml) {
   try {
     LayoutBlock[] alb =
         LayoutGenerator.getLayout(
             sc, XML.parse("<output>" + xml + "</output>").getDocumentElement());
     System.err.println(alb[0].debugDisplay(""));
     Document d = XML.newDocument();
     alb[0].buildXML(d, new HashMap<LayoutInline, LayoutInline.NodePos>());
     debugOutput(d.getDocumentElement());
     for (int i = 0; i < alb.length; i++) scroll.addBlock(alb[i]);
   } catch (Exception le) {
     throw new Error(le);
   }
 }