Hi Samuel, Apologies for not getting back to you sooner. I was travelling most of last week.
The override for the StAX parser is similar to what's documented on the Xalan website. You'll want to set the javax.xml.stream.XMLInputFactory system property to the class name of Woodstox's XMLInputFactory implementation. If you want to test with a different XMLStreamWriter you'd set javax.xml.stream.XMLOutputFactory. Thanks for the updates. Michael Glavassevich XML Technologies and WAS Development IBM Toronto Lab E-mail: [email protected] E-mail: [email protected] Samuel Medeiros <[email protected]> wrote on 09/17/2013 07:56:26 AM: > Hi Michael, > > I read on the Xalan's Website how to plug a different XML parser [1]. > I'm gonna work on this today. > > This week, I intend to fix the issues with the StAXResult adapter > and write a simple report of my work this summer. > > Sincerely, > Samuel > > [1] http://xalan.apache.org/xalan-j/usagepatterns.html#plug > > 2013/9/6 Samuel Medeiros <[email protected]> > Hi Michael, > > The attached patch contains the code for supporting both StAXSource > and StAXResult. > Implementing StAXResult support was more complex than implementing > StAXSource support. Therefore, there are some issues to be fixed. > > To evaluate the adapters for StAXResult, I generated outputs with > all 4 possible methods (html, text, xhtml and xml) using and don’t > using the 2 StAX adapters (event and stream), totalizing 16 files. > The result files that match with birds-stax-event.* were produced > using the event adapter. Those ones that match with birds-stax- > stream.* were produced using the stream adapter. The other ones > (matching with birds-stream.*) were produced without an adapter, > i.e., not using StAXSource / StAXResult. See StAXTransform.java for > details on generation. > All these files are in an attached file called “evaluation.zip” . > > The table below shows the behavior of the stream and event adapters > (both produce the same result) in comparison to an approach without > using StAXSource / StAXResult: > > > Method > > Behavior > > HTML > > Instead of declaring a meta tag into the head one, declares a > doctype tag as first element in the document. > Compare the files birds-stax-event.html, birds-stax-stream.html and > birds-stream.html. > > XML > > Same output, but it isn’t generating the encoding information. > Compare the files birds-stax-event.xml, birds-stax-stream.xml and > birds-stream.xml. > > XHTML > > Same behavior described above (XML method). > Compare the files birds-stax-event.xhtml, birds-stax-stream.xhtml > and birds-stream.xhtml. > > TEXT > > Same output. > Compare the files birds-stax-event.text, birds-stax-stream. text and > birds-stream.text. > > In addition, note that there is a formatting issue: the elements > that aren’t generated inside a <xsl:apply-templates /> aren’t indented. > -- > I think the difference when using the HTML method isn’t a problem. > > I tried to fix other differences (encoding information and > indentation) in the adapters and I didn’t find any bug. > I think there are bugs in the StAX implementation that is being used. > Then, I would like to know what I should change to use Woodstox > instead of Xerces and investigate these issues. > > Thanks, > Samuel > > 2013/8/31 Samuel Medeiros <[email protected]> > Hi, > > I've implemented the StAXResult support by creating adapters, as it > was planned. > I did a test by running the SimpleTransform sample and I got the > correct output. > > Now I'm gonna test the adapters with a more complex sample that I'm > gonna create. > Soon, I will prepare and send the patch for your evaluation. > > Thanks, > Samuel > > 2013/8/18 Samuel Medeiros <[email protected]> > Hi Michael, > > I'm glad to see that you liked the patch. > > I already have the needed knowledge to finish this GsOC project. > > I've verified if the same approach (an adaptor) may be used for the > StAXResult support. The answer is yes. :) > > I'm already implementing the SAX to StAX adapter and I intend to > finish this until the next weekend. > After I am planing to work creating some samples. > > Thanks, > Samuel > > 2013/8/14 Michael Glavassevich <[email protected]> > Hi Samuel, > > I've been reading though the code. This patch looks great. > > Is there any help that you need from us? > > Thanks. > > Michael Glavassevich > XML Technologies and WAS Development > IBM Toronto Lab > E-mail: [email protected] > E-mail: [email protected] > Samuel Medeiros <[email protected]> wrote on 08/06/2013 05:07:43 PM: > > > Greetings, > > > > I have completly integrated the adapter I have developed. > > Now, we are able to supply a StAXSource when creating the > > transformer as well as when doing the transformation: > > > > Transformer transformer = TransformerFactory.newInstance > > ().newTransformer(new StAXSource(..)); > > > > transformer.transform(new StAXSource(..), new StreamResult(..)); > > > > You can find attached the code patch and a modified version of the > > SimpleTransform example that I am using for testing purposes. > > > > -- > > > > Michael, > > > > As I said, I was in a exchange year in France. > > Tomorrow I am going back to Brazil and I will be unavailable until > > the beginning of next week. > > After, I am gonna keep working and implement the StAXResult support. > > > > Thanks, > > Samuel > > > > 2013/8/2 Samuel Medeiros <[email protected]> > > Hello, > > > > I just submitted my midterm evaluation. > > Now I am gonna keep working and I will tell you once I have news. > > > > Thanks, > > Samuel > > > > > 2013/7/30 Samuel Medeiros <[email protected]> > > Hello, > > > > I started the integration of the code I have developed and, by now, > > we are able to create a transformer by loading the .xsl file into a > > StAXSource instance. For example: > > > > TransformerFactory tFactory = TransformerFactory.newInstance(); > > > > StAXSource source = null; > > try { > > source = new StAXSource(XMLInputFactory.newInstance() > > .createXMLEventReader( > > new FileInputStream("src/SimpleTransform/ > > birds.xsl"))); > > } catch (XMLStreamException e) { > > e.printStackTrace(); > > } catch (FactoryConfigurationError e) { > > e.printStackTrace(); > > } > > > > Transformer transformer = tFactory.newTransformer(source); > > > > The patch is attached. Some changes were necessary in dependencies: > > In .classpath, the execution environment needed to be updated from > > J2SE-1.3 to J2SE-1.5, for Generics supporting; > > The xml-apis.jar needed to be updated. I downloaded the latest xml- > > commons version available at [1] and extracted it. > > > > The next steps are: > > Rethrow possible exceptions when handling StAXSource with properly > > messages (XSLMessages.createMessage(...)); > > Integrate StAXSource into the Transformer, allowing to call it like: > > transformer.transform(new StAXSource(...), new StreamResult(...)); > > --- > > > > This week we have to submit the midterm evaluations. > > I am gonna prepare and submit it until tomorrow. I will let you know > > when it's done. > > > > Sincerely, > > Samuel > > > > [1] http://xerces.apache.org/mirrors.cgi > > > > > 2013/7/22 Michael Glavassevich <[email protected]> > > Hi Samuel, > > > > Samuel Medeiros <[email protected]> wrote on 07/21/2013 06:51:31 PM: > > > > > Hi, > > > > > > I have tested the adapter with the Woodstox' StAX implementation. > > > I got the 'endPrefixMapping' events, as expected. Thus, it is a > > > possible bug in the built-in java implementation. I am using java 7 > > update 15. > > > > > > How should we proceed to report this? > > > You can submit bugs against the JDK here [1]. Good news that Woodstox > > works though. Many Apache projects rely on Woodstox instead of the JDK > > built-in StAX implementation. > > > > > -- > > > > > > This week I am gonna integrate the work I have done into Xalan and > > > study the possibility to use the same approach (an adaptor) to > > > provide StAXResult support. > > > Thanks again for the update. > > > > > Thanks, > > > Samuel > > > > <snip/> > > > > > > > > -- > > > Samuel de Medeiros Queiroz > > > Formal Methods Group (GMF - UFCG - Brazil) > > > Thanks. > > > > [1] http://bugreport.sun.com/bugreport/ > > > > Michael Glavassevich > > XML Technologies and WAS Development > > IBM Toronto Lab > > E-mail: [email protected] > > E-mail: [email protected] > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > > -- > > Samuel de Medeiros Queiroz > > Formal Methods Group (GMF - UFCG - Brazil) > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [email protected] > > For additional commands, e-mail: [email protected] > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected]
