You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2004/05/25 00:46:50 UTC

cvs commit: jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/locate DiscoveryLocator.java

burton      2004/05/24 15:46:50

  Modified:    feedparser/src/java/org/apache/commons/feedparser
                        AtomFeedParser.java
               feedparser/src/java/org/apache/commons/feedparser/locate
                        DiscoveryLocator.java
  Log:
  Fixed bug in Atom 0.3 conformance with mode
  
  Revision  Changes    Path
  1.7       +12 -9     jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/AtomFeedParser.java
  
  Index: AtomFeedParser.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/AtomFeedParser.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- AtomFeedParser.java	29 Apr 2004 09:36:25 -0000	1.6
  +++ AtomFeedParser.java	24 May 2004 22:46:50 -0000	1.7
  @@ -162,7 +162,7 @@
               Element content = (Element)i.next();
   
               String type = content.getAttributeValue( "type", "text/plain" );
  -            String mode = content.getAttributeValue( "mode", "xml" );
  +            String mode = content.getAttributeValue( "mode" );
   
               String format = null;
               String encoding = null;
  @@ -170,13 +170,14 @@
               String value = null;
   
               //
  -            if ( mode.equals( "xml" ) ) {
  +            if ( "xml".equals( mode ) ) {
                   value = content.getText();
  -            } 
  -
  -            if ( mode.equals( "escaped" ) ) {
  +            } else if ( "escaped".equals( mode ) ) {
  +                value = getXMLOfContent( content.getContent() );
  +            } else {
  +                mode = "xml";
                   value = getXMLOfContent( content.getContent() );
  -            } 
  +            }
   
               boolean isSummary = false;
               
  @@ -194,7 +195,9 @@
               String format = "application/xhtml+xml";
               String encoding = null;
               String mode = "xml";
  - 
  +
  +            //FIXME: get xml:base
  +            
               String value = getXMLOfContent( e );
               boolean isSummary = true;
               
  @@ -215,7 +218,7 @@
        */
       private static String getXMLOfContent( List content ) {
   
  -        StringBuffer buff = new StringBuffer( 1000 ); 
  +        StringBuffer buff = new StringBuffer( 10000 ); 
                   
           XMLOutputter outputter = new XMLOutputter( "    ", true );
   
  
  
  
  1.8       +4 -0      jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/locate/DiscoveryLocator.java
  
  Index: DiscoveryLocator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/feedparser/src/java/org/apache/commons/feedparser/locate/DiscoveryLocator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DiscoveryLocator.java	23 Apr 2004 17:45:43 -0000	1.7
  +++ DiscoveryLocator.java	24 May 2004 22:46:50 -0000	1.8
  @@ -82,6 +82,10 @@
                   if ( type.equals( RSS_MEDIA_TYPE ) )
                       list.setAdRSSFeed( feedReference );
   
  +                //FIXME: we SHOULD add XML_MEDIA_TYPE discovery here but we have
  +                //no real idea what to do with it since it might be any document
  +                //type. text/xml is very generic.
  +                
                   return list;
               }
               
  
  
  

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