public void setJaxbElement(JAXBResult result) throws JAXBException { setJaxbElement((E)result.getResult()); }
public Word2003XmlConverter(Source source) throws JAXBException, Docx4JException { // Use 2003-import.xsl to convert to a Transition03To06 object java.lang.ClassLoader classLoader = Word2003XmlConverter.class.getClassLoader(); JAXBResult result = new JAXBResult( JAXBContext.newInstance("org.docx4j.convert.in.word2003xml", classLoader) ); XmlUtils.transform(source, xslt, null, result); // set the unmarshalled content tree transitionContainer = (Transition03To06)result.getResult(); }
Object ddJaxb = result.getResult(); DiagramDataPart.setFriendlyIds(XmlUtils.unwrap(ddJaxb));
new StreamSource(new java.io.StringReader(str)), mcPreprocessorXslt, null, result); return result.getResult(); } catch (Exception e) { throw new JAXBException("Preprocessing exception", e);
Object ddJaxb = result.getResult(); DiagramDataPart.setFriendlyIds(XmlUtils.unwrap(ddJaxb));
mcPreprocessorXslt, null, result); return //XmlUtils.unwrap( result.getResult() ; } catch (Exception e) { throw new JAXBException("Preprocessing exception", e);
XmlUtils.transform(doc, mcPreprocessorXslt, null, result); jaxbElement = (E) XmlUtils.unwrap( result.getResult() ); } catch (Exception e) { throw new JAXBException("Preprocessing exception", e);
mcPreprocessorXslt, null, result); jaxbElement = (E) XmlUtils.unwrap( result.getResult() ); } catch (Exception e) { throw new JAXBException("Preprocessing exception", e);
org.docx4j.xmlPackage.Package wmlPackageEl = (org.docx4j.xmlPackage.Package)XmlUtils.unwrap(result.getResult());
@Override public T getResult() { try { return (T) result.getResult(); } catch (JAXBException e) { throw new RuntimeException(e); } }
MySourceJaxbClass sourceObject = // ... Transformer transformer = transformerFactory.newTransformer(xsltSource); JAXBContext context = // however you need to create your context Source src = new JAXBSource(context, sourceObject); JAXBResult res = new JAXBResult(context); transformer.transform(src, res); MyTargetJaxbClass resultObject = (MyTargetJaxbClass)res.getResult();
private static Foo unmarshalDocument(InputStream xslStream, InputStream xmlStream) throws Exception { StreamSource stylesource = new StreamSource(xslStream); StreamSource inputStream = new StreamSource(xmlStream); Transformer transformer = TransformerFactory.newInstance().newTransformer(stylesource); JAXBResult result = new JAXBResult(context); transformer.transform(inputStream, result); return (Foo) result.getResult(); }
TransformerFactory tf = TransformerFactory.newInstance(); StreamSource xslt = new StreamSource(new FileInputStream("my-xslt.xml")); Transformer t = tf.newTransformer(xslt); JAXBContext jc = JAXBContext.newInstance(MyClass.class); JAXBSource source = new JAXBSource(jaxbContext1, foo); JAXBResult result = new JAXBResult(jaxbContext2); t.transform(source, result); Bar bar = (Bar) result.getResult();
public Word2003XmlConverter(Source source) throws JAXBException, Docx4JException { // Use 2003-import.xsl to convert to a Transition03To06 object java.lang.ClassLoader classLoader = Word2003XmlConverter.class.getClassLoader(); JAXBResult result = new JAXBResult( JAXBContext.newInstance("org.docx4j.convert.in.word2003xml", classLoader) ); XmlUtils.transform(source, xslt, null, result); // set the unmarshalled content tree transitionContainer = (Transition03To06)result.getResult(); }
public static JavaWsdlMappingType transformAndRead(Source src, boolean disableXmlSecurity) throws TransformerException, JAXBException { Source xsl = new StreamSource(Util.class.getResourceAsStream(TRANSLATE_NAMESPACES_XSL)); JAXBResult result = new JAXBResult(jaxbContext(disableXmlSecurity)); TransformerFactory tf = XmlUtil.newTransformerFactory(!disableXmlSecurity); Transformer transformer = tf.newTemplates(xsl).newTransformer(); transformer.transform(src, result); return getJavaWsdlMapping(result.getResult()); }
public static JavaWsdlMappingType transformAndRead(Source src, boolean disableXmlSecurity) throws TransformerException, JAXBException { Source xsl = new StreamSource(Util.class.getResourceAsStream(TRANSLATE_NAMESPACES_XSL)); JAXBResult result = new JAXBResult(jaxbContext(disableXmlSecurity)); TransformerFactory tf = XmlUtil.newTransformerFactory(!disableXmlSecurity); Transformer transformer = tf.newTemplates(xsl).newTransformer(); transformer.transform(src, result); return getJavaWsdlMapping(result.getResult()); }
public static JavaWsdlMappingType transformAndRead(Source src, boolean disableXmlSecurity) throws TransformerException, JAXBException { Source xsl = new StreamSource(Util.class.getResourceAsStream(TRANSLATE_NAMESPACES_XSL)); JAXBResult result = new JAXBResult(jaxbContext(disableXmlSecurity)); TransformerFactory tf = XmlUtil.newTransformerFactory(!disableXmlSecurity); Transformer transformer = tf.newTemplates(xsl).newTransformer(); transformer.transform(src, result); return getJavaWsdlMapping(result.getResult()); }
public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException { try { JAXBResult r = new JAXBResult(unmarshaller); // bridge marshals a fragment, so we need to add start/endDocument by ourselves r.getHandler().startDocument(); bridge.marshal(jaxbObject,r); r.getHandler().endDocument(); return (T)r.getResult(); } catch (SAXException e) { throw new JAXBException(e); } } /** @deprecated */
public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException { try { JAXBResult r = new JAXBResult(unmarshaller); // bridge marshals a fragment, so we need to add start/endDocument by ourselves r.getHandler().startDocument(); bridge.marshal(jaxbObject,r); r.getHandler().endDocument(); return (T)r.getResult(); } catch (SAXException e) { throw new JAXBException(e); } } /** @deprecated */
public <T> T readAsJAXB(Unmarshaller unmarshaller) throws JAXBException { try { JAXBResult r = new JAXBResult(unmarshaller); // bridge marshals a fragment, so we need to add start/endDocument by ourselves r.getHandler().startDocument(); bridge.marshal(jaxbObject,r); r.getHandler().endDocument(); return (T)r.getResult(); } catch (SAXException e) { throw new JAXBException(e); } } /** @deprecated */