PDA

View Full Version : Bug in RssReader with translations?



alibert
2005-04-27, 04:11 PM
Hi,

I think there is a little Bug in the RssReader Plugin when having a language.xml file in use.

Here is the stack trace:



************** Ausnametext **************
System.Xml.XPath.XPathException: '/language/translate[@originalText="Error: '/language/translate[@originalText="Na, und worum geht's?" Christian Rahn gestaltet den Gesprchseinstieg herausfordernd. Weil er wei, dass seine Geschichte den Stoff liefert fr Klischeebehaftetes. "Absturz eines Jungstars" zum Beispiel. Oder: "Ein Nationalspieler als Zweitliga-Ersatz.""]' ist ein ungltiger Token."]' ist ein ungltiger Token.
at System.Xml.XPath.XPathParser.ParseStep(AstNode qyInput)
at System.Xml.XPath.XPathParser.ParseRelativeLocation Path(AstNode qyInput)
at System.Xml.XPath.XPathParser.ParseRelativeLocation Path(AstNode qyInput)
at System.Xml.XPath.XPathParser.ParseLocationPath(Ast Node qyInput)
at System.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput)
at System.Xml.XPath.XPathParser.ParseUnionExpr(AstNod e qyInput)
at System.Xml.XPath.XPathParser.ParseUnaryExpr(AstNod e qyInput)
at System.Xml.XPath.XPathParser.ParseMultiplicativeEx pr(AstNode qyInput)
at System.Xml.XPath.XPathParser.ParseAdditiveExpr(Ast Node qyInput)
at System.Xml.XPath.XPathParser.ParseRelationalExpr(A stNode qyInput)
at System.Xml.XPath.XPathParser.ParseEqualityExpr(Ast Node qyInput)
at System.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput)
at System.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput)
at System.Xml.XPath.XPathParser.ParseXPathExpresion(S tring xpathExpresion)
at System.Xml.XPath.XPathNavigator.Compile(String xpath)
at System.Xml.XPath.XPathNavigator.Select(String xpath)
at System.Xml.XmlNode.SelectSingleNode(String xpath)
at GBPVR.Public.SkinHelper.getTranslation(String text)
at cg.a(Boolean& A_0)
at q.r()
at cg.b(String A_0)
at q.a(Message& A_0)
at System.Windows.Forms.ControlNativeWindow.OnMessage (Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(M essage& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


I think it happens when trying to translate a text body from a rss news with invalid (non ANSI?) characters in it.

Maybe such strings could be excluded from translation?

-alibert

HenkH
2005-04-27, 11:32 PM
Are you sure the RSS plugin is to blame? When I look at the trace you posted I can't see any reference to the RSS plugin. The appearance of obfusicated classes/methods might indicate the error occurs in the base GB-PVR application or one of the standard skins. The RSS-plugin doesn't explicitly call any of the language functions.

If you post a link to the offending feed and your language.xml I will look into it.

alibert
2005-04-28, 06:13 AM
Hi,

of course I'm not sure if it is the plugin which crashes the application. I thought because of the call of "GBPVR.Public.SkinHelper.getTranslation(String text)" that the plugin is actively trying to translate the text.

Here is the additional information:

The feed is: http://photodb.kicker.de/library/rss091/kicker.xml , for example.

My language.xml file is attached.

Thanks for your help,

-alibert

alibert
2005-04-30, 07:48 AM
Hi,

I've just tried a very basic language.xml file, containing just those two entries:



<language>
<translate originalText="TV Guide" translatedText="blahblah"/>
<translate originalText="Search Guide" translatedText="ascacs"/>
</language>


Again, the application crashed when reading a RSS-Feed. Then, I investigated that the exception always occurs when the character >"< is in the feed (a double quote / quotation mark).
So I don't think that it has something to do with any translations or country-specific characters in the feed.
[I've changed the topic title accordingly]

-alibert

alibert
2005-04-30, 10:31 AM
Hi again,

I've downloaded the sourcecode for the news plugin and added three string-replacement operations to avoid the double-quotes to be displayed. I replaced them with two single-quotes (" to ''), which should look okay with most proportional fonts

It seemed that when drawing things via the SkinHelper, strings are automatically tried to be translated.

I've attached the modified file RssFeed.cs.

-alibert

KingArgyle
2005-04-30, 02:52 PM
The feed then is sending non-valid XML if they aren't escaping the double quotes/quotation marks with &quote;. In order for it to be a well formed XML document it needs to have that escape code anytime a quote appears in the text. Same thing goes for an ampersand appearing in the text.

rumbert
2005-04-30, 07:04 PM
Hi, I have the same problem. I'm using translation spanish language.xml file, and when I'm reading rss feeds GBPVR hangs.

The attach file is the window message results.

Without the translation file, GBPVR runs ok.

sub
2005-04-30, 07:07 PM
Just stop using those badly formed RSS feeds, or report the problem to the respective websites that are supplying the RSS information.