abdera-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Klein" <jeff.kl...@markmonitor.com>
Subject RE: Parsing XHTML from Atom using Abdera
Date Wed, 07 Jul 2010 22:01:06 GMT
Chaitali,

You can get the <div> element as a String by calling content.getValue() in the putEntry()
or postEntry() method implementation of your CollectionAdapter.

Example:

	public SomeObject postEntry(String title, IRI id, String summary,
			Date updated, List<Person> authors, Content content,
			RequestContext request) throws ResponseContextException {

		String theDiv = content.getValue();
		return new SomeObject(theDiv);
	}

Hope this helps.

Jeff

-----Original Message-----
From: Chaitali Gupta [mailto:chaitaligupta80@yahoo.com] 
Sent: Wednesday, July 07, 2010 2:12 PM
To: user@abdera.apache.org
Subject: Parsing XHTML from Atom using Abdera

Hi, 

I need to parse an ATOM using Abdera. But the ATOM contains entries with XHTML content. Here
is an example of how each entry look like -

<entry xmlns="http://www.w3.org/2005/Atom">
    <id>8b35fa9ad258</id>
    <title type="text">SomeTitle</title>
    <updated>2010-07-05T20:47:07Z</updated>
    <author>
        <name>Some Author </name>
    </author>
    <content type="xhtml">
        <div xmlns="http://www.w3.org/1999/xhtml">
            <div class="hnews hentry item">
        <div class="hmedia">
    <a rel="enclosure" type="image/jpeg" href="some reference">
      <img border="0" class="photo" src="some src "></img>
    </a>
    <div class="fn">Some comment</div>
  </div>
  <div class="entry-content">
    <p>"Some Content"</p>
    <p>"More Content"</p>
  </div>
  
  </content>
</entry>

My question is how can I parse the div element and extract images and "entry-content". From
each Abdera Entry object, how do I get Div object? 

Regards
Chaitali 




      

Mime
View raw message