Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Right-click on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: Victor Cheung <vdcheung@gm...> - 2009-05-11 18:58:10
|
Thank you, Michael. Your suggestion worked! I am doing nothing in my setEntityResolver() function and now my custom EntityResolver class is returning cached local copies of DTDs for validation! -v On 11-May-09, at 9:09 AM, Michael Kay <mike@...> wrote: > > You're right, Saxon resets the entityResolver after use. > > You could defend against this by making setEntityResolver() do > nothing (i.e. > overriding the standard behaviour of XMLFilter which passes on > setEntityResolver() to the underlying XMLReader.). > > I've given some thought to whether I should change Saxon so it no > longer > does this. On reflection, I think there are arguments either way, so > it's > probably safer to make no change. A configuration switch to avoid > reusing > the parser might be a possibility. > > Regards, > > Michael Kay > http://www.saxonica.com/ > http://twitter.com/michaelhkay > >> -----Original Message----- >> From: Victor Cheung [mailto:vdcheung@...] >> Sent: 07 May 2009 21:59 >> To: saxon-help@... >> Subject: Re: [saxon] [xsl] setting EntityResolver triggered >> by saxon:parse()? >> >> Hi Michael, >> >> Thank you for your help! >> >> But unfortunately it does not work. The problem is the >> Sender class (net.sf.saxon.event.Sender). It seems to always >> want to reuse the parser and calls config.reuseSourceParser() >> which nullifies my previously set custom EntityResolver class... >> >> During runtime, it correctly works the first time (when >> parsing main source document), but any of my subsequent >> saxon:parse() calls are processed without my EntityResolver >> class since it has been nullified. >> >> Am I correct about this? Maybe I'm not using it properly? >> >> Thanks in advance, >> -v >> >> >> On 6-May-09, at 3:48 PM, Michael Kay <mike@...> wrote: >> >>> In future, please use the saxon-help list or forum (via the saxon >>> project on >>> SourceForge) for questions that are so obviously product-specific. >>> >>> The implementation of saxon:parse() will try to create an >> instance of >>> the class registered in the Saxon Configuration using >>> setSourceParserClass() (or >>> -x on the command line). This must be an implementation of >> XMLReader. >>> You could define your own implementation of XMLReader that >> proxies or >>> subclasses a standard SAX parser after preinitializing its >>> EntityResolver. The only possible problem is that this parser class >>> would also be used for other documents, for example those >> read using >>> doc() or document(). >>> >>> Michael Kay >>> http://www.saxonica.com/ >>> >>>> -----Original Message----- >>>> From: Victor Cheung [mailto:vdcheung@...] >>>> Sent: 06 May 2009 19:27 >>>> To: xsl-list@... >>>> Subject: [xsl] setting EntityResolver triggered by saxon:parse()? >>>> >>>> Hihi all, >>>> >>>> I'm using saxon:parse() in my stylesheet to parse documents >>>> embedded into elements of my source data file (wrapped by CDATA). >>>> >>>> Everything works beautifully except now I would like to set >>>> my own custom EntityResolver so that I can pass the XML >>>> parser a locally retrieved DTD file it will use to validate >>>> (i.e. I don't want it to actually go out to the Internet for >>>> the http://www.w3.org XHTML 1.0 DTD file) >>>> >>>> Does anyone know if there is an easy way to do this? I >> looked at the >>>> parse() implementation and there doesn't seem to be a way to >>>> hook in a custom EntityResolver. >>>> >>>> Thanks in advance, >>>> -v >>>> >>>> >> --~------------------------------------------------------------------ >>>> XSL-List info and archive: >> http://www.mulberrytech.com/xsl/xsl-list >>>> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ >>>> or e-mail: <mailto:xsl-list-unsubscribe@...> >>>> --~-- >>>> >>> >>> >>> >> --~------------------------------------------------------------------ >>> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list >>> To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ >>> or e-mail: <mailto:xsl-list-unsubscribe@...> >>> --~-- >>> >> >> -------------------------------------------------------------- >> ---------------- >> The NEW KODAK i700 Series Scanners deliver under ANY >> circumstances! Your >> production scanning environment may not be a perfect world - >> but thanks to >> Kodak, there's a perfect scanner to get the job done! With >> the NEW KODAK i700 >> Series Scanner you'll get full speed at 300 dpi even with all image >> processing features enabled. http://p.sf.net/sfu/kodak-com >> _______________________________________________ >> saxon-help mailing list archived at http://saxon.markmail.org/ >> saxon-help@... >> https://lists.sourceforge.net/lists/listinfo/saxon-help > > > --- > --- > --- > --------------------------------------------------------------------- > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! > Your > production scanning environment may not be a perfect world - but > thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW > KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > saxon-help mailing list archived at http://saxon.markmail.org/ > saxon-help@... > https://lists.sourceforge.net/lists/listinfo/saxon-help |