Reputation: 66
My goal is to validate some XML document against Schematron file in Android. At the moment I am trying to use this library for Java. So far, it doesn't seem to be working at all, I simply get empty array as the result of transform. This is piece of code from the library method I adjusted a bit.
Source xsltSource = (Source) jur.resolve( "iso_svrl_for_xslt2.xsl", null );
Source schemaSource = new StreamSource(this.schemaAsStream);
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(xsltSource);
transformer.transform(xsltSource, new StreamResult( baos ));
Does anyone have an idea how to get Transformer working for Android? Thanks in advance.
Upvotes: 0
Views: 278
Reputation: 12312
The Extensible Stylesheet Language Transformations (XSLT)
APIs can be used for many purposes. For example, with a sufficiently intelligent stylesheet, you could generate PDF or PostScript output from the XML data. But generally, XSLT is used to generate formatted HTML
output (that we can consume in our Android Webview
), or to create an alternative XML representation of the data. This will help you.
Upvotes: 1