Results 1 to 8 of 8

Thread: Bug in RssReader with translations?

  1. #1
    Join Date
    Apr 2005
    Posts
    976

    Bug in RssReader when reading a quotaion mark (")?

    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:

    Code:
    ************** 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.ParseRelativeLocationPath(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseRelativeLocationPath(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseLocationPath(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParsePathExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseUnionExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseUnaryExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseMultiplicativeExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseAdditiveExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseRelationalExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseEqualityExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseAndExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseOrExpr(AstNode qyInput)
       at System.Xml.XPath.XPathParser.ParseXPathExpresion(String 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(Message& 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
    Last edited by alibert; 2005-04-30 at 07:49 AM.

  2. #2
    Join Date
    Mar 2005
    Location
    Netherlands
    Posts
    100
    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.

  3. #3
    Join Date
    Apr 2005
    Posts
    976
    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
    Last edited by alibert; 2005-04-28 at 06:16 AM.

  4. #4
    Join Date
    Apr 2005
    Posts
    976
    Hi,

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

    Code:
    <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
    Last edited by alibert; 2005-04-30 at 07:50 AM.

  5. #5
    Join Date
    Apr 2005
    Posts
    976
    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

  6. #6
    Join Date
    Nov 2004
    Location
    Columbus, OH
    Posts
    1,273
    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.

  7. #7
    Join Date
    Apr 2005
    Location
    Lleida - Spain
    Posts
    5
    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.

  8. #8
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    90,312
    Just stop using those badly formed RSS feeds, or report the problem to the respective websites that are supplying the RSS information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •