Return-Path: Delivered-To: apmail-jakarta-commons-dev-archive@www.apache.org Received: (qmail 22788 invoked from network); 30 Jan 2006 22:25:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 30 Jan 2006 22:25:09 -0000 Received: (qmail 26557 invoked by uid 500); 30 Jan 2006 22:25:06 -0000 Delivered-To: apmail-jakarta-commons-dev-archive@jakarta.apache.org Received: (qmail 26477 invoked by uid 500); 30 Jan 2006 22:25:05 -0000 Mailing-List: contact commons-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Developers List" Reply-To: "Jakarta Commons Developers List" Delivered-To: mailing list commons-dev@jakarta.apache.org Received: (qmail 26466 invoked by uid 500); 30 Jan 2006 22:25:05 -0000 Received: (qmail 26463 invoked by uid 99); 30 Jan 2006 22:25:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Jan 2006 14:25:05 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received: from [209.237.227.194] (HELO minotaur.apache.org) (209.237.227.194) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 30 Jan 2006 14:25:04 -0800 Received: (qmail 22624 invoked by uid 65534); 30 Jan 2006 22:24:44 -0000 Message-ID: <20060130222444.22623.qmail@minotaur.apache.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit 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 -0000 To: commons-cvs@jakarta.apache.org From: mvdb@apache.org X-Mailer: svnmailer-1.0.5 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N 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 @@ // // - 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