[Yanel-development] Offline and I18n problem [Fwd: [Yanel-commits] rev 20628 - public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources]

Josias Thöny josias.thoeny at wyona.com
Thu Dec 7 15:39:32 CET 2006


On Wed, 2006-12-06 at 23:53 +0100, Michael Wechner wrote:
> Andreas Wuest wrote:
> 
> > Hi
> >
> > On 6.12.2006 22:35 Uhr, Michael Wechner wrote:
> >
> >> Hi
> >>
> >> It seems that the I18n transformation tries to connect to the 
> >> internet and hence it doesn't work when being offline.
> >>
> >> Any idea why it tries to connect to the internet?
> >
> >
> > No matter what happens with unknown entity files, the snippet you 
> > commented out does not contain the call to setEntityResolver(), so 
> > even IF the external entity document was present on the system, it 
> > wouldn't get resolved via the catalog mechanism.
> 
> 
> well, after I have commented it, then it worked ;-)
> 
> IIRC we had the same problem with the Wiki resource and David changed 
> something and then it worked as well.
> 
> Maybe we just wait until David can take a look at it tomorrow ;-)


FYI, the DTD loading can be turned off like this:

xmlReader.setFeature("http://xml.org/sax/features/validation", false);
xmlReader.setFeature("http://apache.org/xml/features/nonvalidating/load-external-dtd", false);

But it also disables validation, so it's probably not a good solution.
Or what do you think?

BTW, which DTD was causing the problems? The yanel-website works for me
even when I'm offline. 
The yulup-website however does not, because some pages reference the
following DTD, which is not stored in the entities dir:
http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd

Should we add this DTD to our entities dir?

josias



> 
> Cheers
> 
> Michi
> 
> >
> >> Thanks
> >>
> >> Michi
> >>
> >> -------- Original Message --------
> >> Subject:     [Yanel-commits] rev 20628 - 
> >> public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources 
> >>
> >> Date:     Wed, 06 Dec 2006 22:24:48 +0100
> >> From:     michi at wyona.com
> >> Reply-To:     yanel-commits at wyona.com
> >> To:     yanel-commits at wyona.org
> >>
> >>
> >>
> >> Author: michi
> >> Date: 2006-12-06 22:24:47 +0100 (Wed, 06 Dec 2006)
> >> New Revision: 20628
> >>
> >> Modified:
> >>   
> >> public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java 
> >>
> >> Log:
> >> I18n commented because it doesn't work when offline
> >>
> >> Modified: 
> >> public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java 
> >>
> >> ===================================================================
> >> --- 
> >> public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java    
> >> 2006-12-06 20:41:00 UTC (rev 20627)
> >> +++ 
> >> public/yanel/trunk/src/resources/xml/src/java/org/wyona/yanel/impl/resources/XMLResource.java    
> >> 2006-12-06 21:24:47 UTC (rev 20628)
> >> @@ -108,11 +108,14 @@
> >>                 transformer.transform(new SAXSource(xmlReader, new 
> >> org.xml.sax.InputSource(getContentXML(rp, yanelPath))), new 
> >> StreamResult(baos));
> >>
> >>                 InputStream inputStream = new 
> >> ByteArrayInputStream(baos.toByteArray());
> >> +/*
> >>                 I18nTransformer i18nTransformer = new 
> >> I18nTransformer("global", language);
> >>                 SAXParser saxParser = 
> >> SAXParserFactory.newInstance().newSAXParser();
> >>                 saxParser.parse(inputStream, i18nTransformer);
> >>
> >>                 
> >> defaultView.setInputStream(i18nTransformer.getInputStream());
> >> +*/
> >> +                defaultView.setInputStream(inputStream);
> >>
> >>                 return defaultView;
> >>             } else {
> >
> >
> 
> 




More information about the Yanel-development mailing list