示例#1
0
 private static DomElement createDomElement(String xml) {
   XppDomWriter domWriter = new XppDomWriter();
   new HierarchicalStreamCopier()
       .copy(new XppReader(new StringReader(xml), new MXParser()), domWriter);
   XppDom xppDom = domWriter.getConfiguration();
   return new XppDomElement(xppDom);
 }
示例#2
0
 @Override
 public void convertValueToDom(Object value, DomElement parentElement)
     throws ConversionException {
   Style style = (Style) value;
   final SLDTransformer transformer = new SLDTransformer();
   transformer.setIndentation(2);
   try {
     final String s = transformer.transform(style);
     XppDomWriter domWriter = new XppDomWriter();
     new HierarchicalStreamCopier().copy(new XppReader(new StringReader(s)), domWriter);
     parentElement.addChild(new XppDomElement(domWriter.getConfiguration()));
   } catch (TransformerException e) {
     throw new IllegalArgumentException(e);
   }
 }