Validating after styling isn't really a concept supported by XSLT 1.0. The
simplest thing to do is let Xalan write out its result and read that back
in with Xerces set to validating mode. Not very efficient, but guaranteed
to work.
If you're willing to try alpha-level code, you could try taking the
version of Xalan that's on the "xslt20" branch of the Apache CVS server.
That partially implements a not-necessarily-current and
not-necessarily-complete version of XSLT 2.0, and last time I checked
(several months ago!) it included a working version of the validate()
function added by 2.0. However, Xerces has changed its internal APIs since
then and I'm not sure everything got glued back together successfully...
and this is still evolving both at the spec level and at the
implementation level, so don't be too surprised if it still has bugs.
(Note too that validate() tests the generated tree against the schema
specified by the stylesheet, *NOT* necessarily against the one specified
by the generated document's schema hints.)
______________________________________
Joe Kesselman, IBM Next-Generation Web Technologies:
XML, XSL and more. "may'ron DaroQbe'chugh vaj bIrIQbej"
("Put down the squeezebox and nobody gets hurt.")