Hello all,

I've started a project involving rather complicated FOP generation. I have the 
details on what exactly I'm trying to do on my weblog here: 
http://codeforfun.wordpress.com/2006/06/12/new-xml-grammar/

In short, I'm writing a stylesheet that transforms a custom XML grammar into 
XSL-FO stylesheets. These generated XSL-FO stylesheets (XSLT templates that 
generate raw FO using input XML) will be used to process an input XML and 
generate PDFs. My current problem regards unit testing pieces of my solution. 
I currently need a way to validate first the XSL-FO that I generate and 
secondly validate the FO that the generated XSL-FO creates. I'm doing a lot 
of manual work right now to acheive this. What I do is load a sample of my 
custom XML grammar (I call it SSML) into a TrAX transform with my 
SSMLStylesheet. (That's what generates the XSL-FO.) I diff it against a 
golden copy of what I believe the output XSL-FO should look like. I've also 
been separately testing the golden copy to make sure it actually works and 
generates a PDF when run against FOP. 

I desparately need a way to streamline the entire process. I want to enahnce 
the golden copy and have an automated test verify that the changes I make 
still generate valid FO syntax. I also want to verify the output of my 
SSMLStylesheet is valid XSLT before diff'ing it against my golden copy. I'm 
also having a little trouble with XMLUnit doing diffs. I've gotten spoiled 
with Idea's auto-diff on failed String assertions in junit tests, so when I 
see the messages generated by XMLUnit it takes a moment to decipher what's 
actually wrong. What I've been doing is trapping the XMLDiff 
AssertionFailedException and doing an assertEquals on the two XML strings so 
I can take advantage of Idea's diff. It's clumsy but I can pick out the error 
a little better this way. The other problem is the generated stylesheets are 
not formatted (indented and such) so even with Idea's string diff I have to 
squint, turn my head sideways and figure it out. What I do then is copy the 
generated stylesheet and paste it in a temp file and format it. That moves 
completely away from unit testing and is more of an eyeball test. So as you 
can see I am really struggling with the testing. I'll stop rambling now. Are 
there any XSL gurus out there that can offer some insight?

--------------------------------------------------- 
Clifton C. Craig, Software Engineer
Tell me what's up...
visit: http://codeforfun.wordpress.com
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to