commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r373611 - in /jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser: AtomFeedParser.java BaseParser.java ChangesFeedParser.java FOAFFeedParser.java OPMLFeedParser.java RSSFeedParser.java TagFeedParser.java
Date Mon, 30 Jan 2006 22:24:42 GMT
Author: mvdb
Date: Mon Jan 30 14:24:36 2006
New Revision: 373611

URL: http://svn.apache.org/viewcvs?rev=373611&view=rev
Log:
've attached a patch that allows commons-feedparser to be built against jdom
1.0. I've changed all references to XPath to JDOMXPath. Also in AtomFeedParser
I've changed the call to new XMLOutputter("        ",  true) to a call to the no
argument constructor as the constructor being used is no longer available.

Patch supplied by Andrew McCall andrew.mccall at goroam.net

See bug 38224

Modified:
    jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/AtomFeedParser.java
    jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/BaseParser.java
    jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/ChangesFeedParser.java
    jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/FOAFFeedParser.java
    jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/OPMLFeedParser.java
    jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java
    jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/TagFeedParser.java

Modified: jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/AtomFeedParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/AtomFeedParser.java?rev=373611&r1=373610&r2=373611&view=diff
==============================================================================
--- jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/AtomFeedParser.java
(original)
+++ jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/AtomFeedParser.java
Mon Jan 30 14:24:36 2006
@@ -108,7 +108,7 @@
                                  FeedParserListener listener,
                                  org.jdom.Document doc ) throws Exception {
 
-        XPath xpath = new XPath( "/atom:feed/atom:entry" );
+        JDOMXPath xpath = new JDOMXPath( "/atom:feed/atom:entry" );
         xpath.setNamespaceContext( NS.context );
 
         List items = xpath.selectNodes( doc );
@@ -196,7 +196,7 @@
 
         LinkFeedParserListener lfpl = (LinkFeedParserListener)listener;
         
-        XPath xpath = new XPath( "atom:link" );
+        JDOMXPath xpath = new JDOMXPath( "atom:link" );
         xpath.setNamespaceContext( NS.context );
 
         List items = xpath.selectNodes( current );
@@ -230,7 +230,7 @@
         
         ContentFeedParserListener clistener = (ContentFeedParserListener)listener;
 
-        XPath xpath = new XPath( "atom:content" );
+        JDOMXPath xpath = new JDOMXPath( "atom:content" );
         xpath.setNamespaceContext( NS.context );
 
         List items = xpath.selectNodes( current );
@@ -273,7 +273,7 @@
             
         }
 
-        xpath = new XPath( "atom:summary[@type='application/xhtml+xml']" );
+        xpath = new JDOMXPath( "atom:summary[@type='application/xhtml+xml']" );
         xpath.setNamespaceContext( NS.context );
         Element e = (Element)xpath.selectSingleNode( current );
 
@@ -311,8 +311,10 @@
         //to do the same thing we do for xhtml:body RIGHT?
         
         StringBuffer buff = new StringBuffer( 10000 ); 
-                
-        XMLOutputter outputter = new XMLOutputter( "    ", true );
+
+        // NOTE: Changed this constructor to use the default Format. Since the
+        // constructor used no longer exists in jdom 1.0.
+        XMLOutputter outputter = new XMLOutputter();
 
         Iterator it = content.iterator();
         
@@ -361,7 +363,7 @@
 
     private static Element selectSingleElement( String query, org.jdom.Document doc ) throws
Exception {
 
-        XPath xpath = new XPath( query );
+        JDOMXPath xpath = new JDOMXPath( query );
         xpath.setNamespaceContext( NS.context );
         
         //perform onChannel method...  (title, link, description)
@@ -371,7 +373,7 @@
 
     private static String selectSingleAttribute( String query, Element element ) throws Exception
{
 
-        XPath xpath = new XPath( query );
+        JDOMXPath xpath = new JDOMXPath( query );
         xpath.setNamespaceContext( NS.context );
         
         //perform onChannel method...  (title, link, description)

Modified: jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/BaseParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/BaseParser.java?rev=373611&r1=373610&r2=373611&view=diff
==============================================================================
--- jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/BaseParser.java
(original)
+++ jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/BaseParser.java
Mon Jan 30 14:24:36 2006
@@ -114,7 +114,7 @@
     //FIXME: unify this with RSSFeedParser.getChildElementTextByName
     protected static String selectText( String query, Element element ) throws Exception
{
 
-        XPath xpath = new XPath( query );
+        JDOMXPath xpath = new JDOMXPath( query );
         xpath.setNamespaceContext( NS.context );
         
         //perform onChannel method...  (title, link, description)
@@ -144,7 +144,7 @@
 
         //FIXME: this can be rewritten to use getChild()
         
-        XPath xpath = new XPath( "descendant::*[local-name() = '" + name + "']" );
+        JDOMXPath xpath = new JDOMXPath( "descendant::*[local-name() = '" + name + "']" );
         Object resultNode = xpath.selectSingleNode( state.current );
 
         String resultText = null;
@@ -161,4 +161,4 @@
         
     }
 
-}
\ No newline at end of file
+}

Modified: jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/ChangesFeedParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/ChangesFeedParser.java?rev=373611&r1=373610&r2=373611&view=diff
==============================================================================
--- jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/ChangesFeedParser.java
(original)
+++ jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/ChangesFeedParser.java
Mon Jan 30 14:24:36 2006
@@ -59,7 +59,7 @@
             FeedDirectoryParserListener fdpl = (FeedDirectoryParserListener)listener;
 
             //this should be the root directory.
-            XPath xpath = new XPath( "/weblogUpdates/weblog" );
+            JDOMXPath xpath = new JDOMXPath( "/weblogUpdates/weblog" );
             List list = xpath.selectNodes( doc );
 
             Iterator i = list.iterator();

Modified: jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/FOAFFeedParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/FOAFFeedParser.java?rev=373611&r1=373610&r2=373611&view=diff
==============================================================================
--- jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/FOAFFeedParser.java
(original)
+++ jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/FOAFFeedParser.java
Mon Jan 30 14:24:36 2006
@@ -56,7 +56,7 @@
                 flistener = (FOAFFeedParserListener)listener;
 
             //this should be the root directory.
-            XPath xpath = new XPath( "/rdf:RDF/foaf:Person" );
+            JDOMXPath xpath = new JDOMXPath( "/rdf:RDF/foaf:Person" );
             xpath.setNamespaceContext( NS.context );
             
             Element person = (Element)xpath.selectSingleNode( doc );
@@ -70,7 +70,7 @@
             if ( flistener != null )
                 flistener.onPerson( state, name );
             
-            xpath = new XPath( "foaf:knows" );
+            xpath = new JDOMXPath( "foaf:knows" );
 
             xpath.setNamespaceContext( NS.context );
 

Modified: jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/OPMLFeedParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/OPMLFeedParser.java?rev=373611&r1=373610&r2=373611&view=diff
==============================================================================
--- jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/OPMLFeedParser.java
(original)
+++ jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/OPMLFeedParser.java
Mon Jan 30 14:24:36 2006
@@ -62,7 +62,7 @@
             FeedDirectoryParserListener fdpl = (FeedDirectoryParserListener)listener;
 
             //this should be the root directory.
-            XPath xpath = new XPath( "/opml/body/outline" );
+            JDOMXPath xpath = new JDOMXPath( "/opml/body/outline" );
             List list = xpath.selectNodes( doc );
 
             Iterator i = list.iterator();
@@ -83,7 +83,7 @@
                                          FeedParserState state,
                                          Element current ) throws Exception {
 
-        XPath xpath = new XPath( "outline" );
+        JDOMXPath xpath = new JDOMXPath( "outline" );
         List list = xpath.selectNodes( current );
 
         Iterator i = list.iterator();

Modified: jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java?rev=373611&r1=373610&r2=373611&view=diff
==============================================================================
--- jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java
(original)
+++ jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/RSSFeedParser.java
Mon Jan 30 14:24:36 2006
@@ -60,7 +60,7 @@
         listener.init();
 
         //*** now process the channel. ***
-        XPath xpath = new XPath( "/descendant::*[local-name() = 'channel']" );
+        JDOMXPath xpath = new JDOMXPath( "/descendant::*[local-name() = 'channel']" );
         Element channel = (Element)xpath.selectSingleNode( doc );
         state.current = channel;
 
@@ -69,7 +69,7 @@
         doLocaleEnd( state, listener, channel );
 
         //*** now process the image. ***
-        xpath = new XPath( "/descendant::*[local-name() = 'image']" );
+        xpath = new JDOMXPath( "/descendant::*[local-name() = 'image']" );
         List images = xpath.selectNodes( doc );
         Iterator i = images.iterator();
         //update items.
@@ -82,7 +82,7 @@
         }
 
         //*** now process all items. ***
-        xpath = new XPath( "/descendant::*[local-name() = 'item']" );
+        xpath = new JDOMXPath( "/descendant::*[local-name() = 'item']" );
 
         List items = xpath.selectNodes( doc );
 
@@ -159,7 +159,7 @@
 
         //FIXME: migrate this to XPath
 
-        XPath xpath = new XPath( "@rdf:resource|guid|descendant::*[local-name() = 'link']"
);
+        JDOMXPath xpath = new JDOMXPath( "@rdf:resource|guid|descendant::*[local-name() =
'link']" );
         xpath.addNamespace( NS.RDF.getPrefix(), NS.RDF.getURI() );
         Object node = xpath.selectSingleNode( state.current );
 

Modified: jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/TagFeedParser.java
URL: http://svn.apache.org/viewcvs/jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/TagFeedParser.java?rev=373611&r1=373610&r2=373611&view=diff
==============================================================================
--- jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/TagFeedParser.java
(original)
+++ jakarta/commons/dormant/feedparser/trunk/src/java/org/apache/commons/feedparser/TagFeedParser.java
Mon Jan 30 14:24:36 2006
@@ -76,7 +76,7 @@
     public static void doDcSubject( TagFeedParserListener listener, 
                                     FeedParserState state ) throws Exception {
 
-        XPath xpath = new XPath( "dc:subject" );
+        JDOMXPath xpath = new JDOMXPath( "dc:subject" );
         xpath.addNamespace( NS.DC.getPrefix(), NS.DC.getURI() );
         
         List list = xpath.selectNodes( state.current );
@@ -107,7 +107,7 @@
 
         //XPath xpath = new XPath( "local-name() = 'category'" );
 
-        XPath xpath = new XPath( "descendant::*[local-name() = 'category']" );
+        JDOMXPath xpath = new JDOMXPath( "descendant::*[local-name() = 'category']" );
 
         //NOTE: this only works for elements without namespaces
         //XPath xpath = new XPath( "category" );
@@ -152,7 +152,7 @@
         //      </rdf:Bag>
         //  </taxo:topics>
  
-        XPath xpath = new XPath( "taxo:topics/rdf:Bag/rdf:li" );
+        JDOMXPath xpath = new JDOMXPath( "taxo:topics/rdf:Bag/rdf:li" );
         xpath.addNamespace( NS.RDF.getPrefix(), NS.RDF.getURI() );
         xpath.addNamespace( NS.TAXO.getPrefix(), NS.TAXO.getURI() );
         



---------------------------------------------------------------------
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