Re: Problem with catalog resolver when resolving references from stylesheet document type declaration - patch available
"USHAKOV, Sergey" <[email protected]> Sat, 1 Oct 2011 08:43:47 +0400
| Newsgroups | gmane.text.xml.xalan.java.user |
|---|---|
| Message-ID | <[email protected]> |
Hi once again, a patched binary build is available from my blog page "XSLT, entities, Java, Xalan..." at http://s-n-ushakov.blogspot.com/2011/09/xslt-entities-java-xalan.html along with some comments and guidelines. Regards, Sergey ----- Original Message ----- From: "USHAKOV, Sergey" <[email protected]> To: <[email protected]> Sent: Wednesday, September 28, 2011 12:38 PM Subject: Re: Problem with catalog resolver when resolving references from stylesheet document type declaration - patch available > Hi again, > > it looks like I have found the cause of the issue, and it looks like a bug > in Xalan. Probably nobody before cared seriously about using external > entities in an XSLT file. > > A patch to Xalan is available that fixes the issue, at least without > XSLTC: https://issues.apache.org/jira/browse/XALANJ-2544 . > > May anybody of the commiters be in a position to have a look? > > Regards, > Sergey > > > > ----- Original Message ----- > From: "USHAKOV, Sergey" <[email protected]> > To: <[email protected]> > Sent: Friday, September 09, 2011 10:36 PM > Subject: Problem with catalog resolver when resolving references from > stylesheet document type declaration > > >> Hi, >> >> I have been using Xalan-J with Catalog Resolver for a long while already. >> It >> was just recently that I ran into an issue with resolving. >> >> It happened when I got an idea to use character entities in XSLT trnsform >> file and added an appropriate declaration to the XSLT file, like this: >> >> <!DOCTYPE transform [ >> <!ENTITY % w3centities-f PUBLIC "-//W3C//ENTITIES Combined >> Set//EN//XML" >> "http://www.w3.org/2003/entities/2007/w3centities-f.ent"> >> %w3centities-f; >> ]> >> <xsl:transform version="1.0" >> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >> ... >> >> Everything was fine, except unusual processing time, even despite the >> enitities declaration was registered with the resolver. The reason became >> clear when I disabled the network connection. The result was a >> "java.net.UnknownHostException: www.w3.org" that flew out of >> org.apache.xalan.xslt.Process. >> >> Enabling full debug in the resolver revealed that nothing is wrong with >> it. >> It honestly reported about appropriate catalog entries (correct ones), >> and >> in case internet connection was present even reported about successful >> resolving of the entities file as a local resource. The only problem was >> that in case internet connection was down, the resolver was not given a >> chance to respond, as the exception flew out earlier. >> >> Curiously, I managed to work around the problem by wrapping the XSLT file >> into another one using 'xsl:include'. In that case no problems occured, >> and >> everything was fine regardless of the internet connection. >> >> My configuration is like this: >> - Windows Vista; >> - jdk1.6.0_25[b01_debug] >> - Xalan-J 2.7.1 >> - Xerces 2.11.0 >> - Apache XML Commons Resolver 1.2 >> >> Frankly, my attempts to debug the problem were not very much successful >> due >> to some unclear problem in getting Xalan and Xerces source recognized by >> the >> Eclipse debugger... >> >> Still the issue looks like a bug, or may I miss something? >> >> Regards, >> Sergey >> >> >