Project

Profile

Help

XdmDestination has null config in 9.1.0.6

Added by Anonymous over 15 years ago

Legacy ID: #6982667 Legacy Poster: David Lee (daldei)

I have found a new case where XdmDestination doesnt set the config in 9.1.0.6. This is a fairly convoluted case. If you need a program to reproduce it will likely take the whole program (xmlsh) but I can get you the source to reproduce this if you want it. Here's the stack trace TinyTree.addNode(short, int, int, int, int) line: 330 TinyTree.addDocumentNode(TinyDocumentImpl) line: 303 TinyBuilder.startDocument(int) line: 134 NamespaceReducer(ProxyReceiver).startDocument(int) line: 98 TreeReceiver.startDocument(int) line: 105 Util.writeXdmValue(XdmValue, Destination) line: 572 xed.run(List<XValue>) line: 211 xed(XCommand).run(List<XValue>, XEnvironment) line: 55 xed(XCommand).run(Shell, String, List<XValue>) line: 45 SimpleCommand.exec(Shell) line: 103 Shell.exec(Command) line: 395 Pipeline.exec(Shell) line: 112 .... config is null here : documentNumber = config.getDocumentNumberAllocator().allocateDocumentNumber(); I can work around this as I did in 9.1.0.5 using this method: private void setupDestination( XdmDestination dest ) { /* * TODO: Remove this extra code when Saxon is fixed * XdmDestinatin shouldn't need the configuration */ Configuration config = Shell.getProcessor().getUnderlyingConfiguration(); try { Receiver r = dest.getReceiver(config); PipelineConfiguration pipe = config.makePipelineConfiguration(); r.setPipelineConfiguration(pipe); ; } catch (SaxonApiException e) { ; } }


Replies (2)

RE: XdmDestination has null config in 9.1.0.6 - Added by Anonymous over 15 years ago

Legacy ID: #6983640 Legacy Poster: Michael Kay (mhkay)

I can't really help with this without knowing what you are doing. We've already established that this code is fragile in 9.1, and I've taken steps to make it more robust in 9.2. The getReceiver() call was really designed for internal use; you're mixing interfaces from different levels in a way that wasn't really intended. Are you calling setPipelineConfiguration on the Receiver returned by XdmDestination, as the JavaDoc says you must?

RE: XdmDestination has null config in 9.1.0.6 - Added by Anonymous over 15 years ago

Legacy ID: #6983691 Legacy Poster: David Lee (daldei)

Thanks. I'm sorry for raising this again, I think I mistakenly thought you'd put the fix for this https://sourceforge.net/tracker/?func=detail&amp;aid=2636940&amp;group_id=29872&amp;atid=397617 Into 9.1.0.6 as apposed to 9.2, When I updated saxon and remove my workaround it worked fine so I thought it was fixed, then I did some recent changes and then noticed it was back so thought I'd found a new unrelated bug. But looking back I think my test cases were not complete and I had imagined it was fixed when it wasnt. As long as I set the configuration myself (as documented) then it works fine. My fault, sorry. -David

    (1-2/2)

    Please register to reply