RE: Merging 2 XML's in to 1 output XML (Performance I
> > The problem is, I don't know whether the ContentHandler > does expect to > > receive data from an XSL transformation. > > If someone's giving the ContentHandler to TrAX, then I think it's a > pretty good bet they expect it to receive output from an XSL > transformation. But they don't necessarily know that the XMLFilter they've invoked is actually an XSLT transformation. The whole point about pipelines is that you don't have to have special knowledge about who's before you and after you in the pipeline. When you call transformerFactory.newXMLFilter() you get an XMLFilter back, and you can pass that to someone who is expecting an XMLReader, and who then calls parse() on it thinking that it's a real parser. That user is entitled to expect that it obeys the contract for XMLReader, which is is that an XMLReader notifies events representing a well-formed document, and when it encounters an event that would make the document ill-formed, it throws an exception. There are no black-and-white right-and-wrong answers here: it's a matter of judgment, and there are different use cases where different designs are optimal. For that reason, Saxon allows you to override the above behavior. Perhaps the default should be different for the XMLFilter scenario from the SAXResult scenario. But it's not a bug if it isn't, it's a design that we can talk about improving. Michael Kay http://www.saxonica.com/
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format