commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bur...@apache.org
Subject cvs commit: jakarta-commons-sandbox/feedparser/tests/filter nbsp-1.xml
Date Thu, 02 Sep 2004 01:19:56 GMT
burton      2004/09/01 18:19:56

  Modified:    feedparser/src/java/org/apache/commons/feedparser
                        FeedFilter.java RSSFeedParser.java
               feedparser/tests/filter nbsp-1.xml
  Log:
  RSS bug where a channel wouldn't have a link... caused an NPI
  
  Revision  Changes    Path
  1.3       +3 -1      jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/FeedFilter.java
  
  Index: FeedFilter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/FeedFilter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FeedFilter.java	2 Sep 2004 00:36:25 -0000	1.2
  +++ FeedFilter.java	2 Sep 2004 01:19:55 -0000	1.3
  @@ -131,6 +131,8 @@
           //
           // Which is correct in Latin1
   
  +        // http://my.netscape.com/publish/formats/rss-0.91.dtd
  +
           LATIN1_ENTITIES.put( "nbsp",      "160" );
           LATIN1_ENTITIES.put( "iexcl",     "161" );
           LATIN1_ENTITIES.put( "cent",      "162" );
  
  
  
  1.11      +7 -2      jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/RSSFeedParser.java
  
  Index: RSSFeedParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/RSSFeedParser.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- RSSFeedParser.java	18 Aug 2004 18:39:10 -0000	1.10
  +++ RSSFeedParser.java	2 Sep 2004 01:19:55 -0000	1.11
  @@ -105,9 +105,14 @@
       private static void doParseChannel( FeedParserListener listener,
                                           FeedParserState state ) throws Exception {
   
  +        String link = getChildElementTextByName( state, "link" );
  +
  +        if ( link != null )
  +            link = link.trim();
  +        
           listener.onChannel( state, 
                               getChildElementTextByName( state, "title" ),
  -                            getChildElementTextByName( state, "link" ).trim(),
  +                            link,
                               getChildElementTextByName( state, "description" ) );
   
           listener.onChannelEnd();
  
  
  
  1.2       +0 -2      jakarta-commons-sandbox/feedparser/tests/filter/nbsp-1.xml
  
  Index: nbsp-1.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/tests/filter/nbsp-1.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- nbsp-1.xml	2 Sep 2004 00:36:25 -0000	1.1
  +++ nbsp-1.xml	2 Sep 2004 01:19:55 -0000	1.2
  @@ -1,7 +1,5 @@
   <?xml version="1.0"?>
   
  -<!-- name="generator" content="blosxom/2.0" -->
  -
   <rss version="0.91">
     <channel>
       <title>EEK Speaks   </title>
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message