Namespace problem

View: New views
2 Messages — Rating Filter:   Alert me  

Namespace problem

by mr.abanjo :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
i'm trying to map this RSS:

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss">
<channel>
<title>Dailymotion</title>
<link>http://.....com</link>
<description>Random video</description>
<lastBuildDate>Tue, 27 Oct 2009 17:43:53 +0100</lastBuildDate>
<item>
            <title><![CDATA[I giochi che fanno diventare]]></title>
<link><![CDATA[http://..../video_download.php?guid=/video/xb3akf_i-giochi-che-fanno-diventare-_fun]]></link>
<guid><![CDATA[http://..../video_download.php?guid=/video/xb3akf_i-giochi-che-fanno-diventare-_fun]]></guid>
<description><![CDATA[Una classifica dei 10 giochi che hanno condizionato le scelte di un'intera generazione.]]></description>
<pubDate>Tue, 10 Nov 2009 09:54:52 +0100</pubDate>
<media:thumbnail url="http://..../proxyimg.s4af92a5c19cb1/21565/image.gif" height="91" width="120" />
</item>
....
</channel>
</rss>


I don't know how to map the "media:thumbbail" value.
I tryed in this way:

<binding>
<mapping name="rss"
class=".........Rss" ordered="false" >
<namespace prefix="media" uri="http://search.yahoo.com/mrss" default="all" />
<value name="version" style="attribute" field="version" usage="optional"/>
<structure name="channel" field="channel" type=".........Channel" ordered="false">
<value name="title" field="title" usage="optional" />
<value name="link" field="link" usage="optional" />
<value name="description" field="description" usage="optional" />
<value name="lastBuildDate" field="lastBuildDate" usage="optional" />
<collection field="items" factory=".........Channel.itemsListFactory" usage="optional">
<structure name="item" type=".........Item" ordered="false" flexible="true">
<value name="title" field="title" usage="optional" />
<value name="link" field="link" usage="optional" />
<value name="guid" field="guid" usage="optional" />
<value name="description" field="description" usage="optional" />
<value name="pubDate" field="pubDate" usage="optional" />
<structure name="thumbnail" type=".........Thumbnail" ordered="false" flexible="true">
<value name="url" style="attribute" field="url" usage="optional"/>
<value name="height" style="attribute" field="height" usage="optional"/>
<value name="width" style="attribute" field="width" usage="optional"/>
</structure>
</structure>
</collection>
</structure>
</mapping>
</binding>

But i receive this error ar runtime:

No unmarshaller for element "rss"

Thanks
Davide




------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@...
https://lists.sourceforge.net/lists/listinfo/jibx-users

Re: Namespace problem

by DSosnoski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

By using default="all" on the <namespace> element you're telling JiBX to
apply it to /all/ elements. You want to just apply it to the <thumbnail>
element. Take off the default="all", and add
ns="http://search.yahoo.com/mrss" on the <structure name="thumbnail"
...> element.

  - Dennis

Dennis M. Sosnoski
XML and Web Services in Java
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



mr.abanjo wrote:

> Hi,
> i'm trying to map this RSS:
>
> <rss version="2.0" xmlns:media="http://search.yahoo.com/mrss">
>
>     <channel>
>         <title>Dailymotion</title>
>         <link>http://.....com</link>
>
>         <description>Random video</description>
>         <lastBuildDate>Tue, 27 Oct 2009 17:43:53 +0100</lastBuildDate>        
>
>         <item>
>  
>             <title><![CDATA[I giochi che fanno diventare]]></title>
>
>             <link><![CDATA[http://..../video_download.php?guid=/video/xb3akf_i-giochi-che-fanno-diventare-_fun]]></link>
>
>             <guid><![CDATA[http://..../video_download.php?guid=/video/xb3akf_i-giochi-che-fanno-diventare-_fun]]></guid>
>
>             <description><![CDATA[Una classifica dei 10 giochi che hanno condizionato le scelte di un'intera generazione.]]></description>
>
>             <pubDate>Tue, 10 Nov 2009 09:54:52 +0100</pubDate>
>             <media:thumbnail url="http://..../proxyimg.s4af92a5c19cb1/21565/image.gif" height="91" width="120" />
>
>         </item>  
>         ....
>        </channel>
> </rss>
>
>
> I don't know how to map the "media:thumbbail" value.
>
> I tryed in this way:
>
> <binding>
> <mapping name="rss"
> class=".........Rss" ordered="false" >
> <namespace prefix="media" uri="http://search.yahoo.com/mrss" default="all" />
>
> <value name="version" style="attribute" field="version"  usage="optional"/>
> <structure name="channel" field="channel" type=".........Channel" ordered="false">
>
> <value name="title" field="title"  usage="optional" />
> <value name="link" field="link"  usage="optional" />
> <value name="description" field="description"  usage="optional" />
>
> <value name="lastBuildDate" field="lastBuildDate"  usage="optional" />
> <collection field="items" factory=".........Channel.itemsListFactory" usage="optional">
>
> <structure name="item" type=".........Item"  ordered="false" flexible="true">
> <value name="title" field="title"  usage="optional" />
>
> <value name="link" field="link"  usage="optional" />
> <value name="guid" field="guid"  usage="optional" />
> <value name="description" field="description"  usage="optional" />
>
> <value name="pubDate" field="pubDate"  usage="optional" />
> <structure name="thumbnail" type=".........Thumbnail" ordered="false" flexible="true">
>
> <value name="url" style="attribute" field="url"  usage="optional"/>
> <value name="height" style="attribute" field="height"  usage="optional"/>
>
> <value name="width" style="attribute" field="width"  usage="optional"/>
> </structure>
> </structure>
> </collection>
>
> </structure>
> </mapping>
> </binding>
>
> But i receive this error ar runtime:
>
> No unmarshaller for element "rss"
>
> Thanks
> Davide
>
>
>
>  
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@...
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>  

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
jibx-users mailing list
jibx-users@...
https://lists.sourceforge.net/lists/listinfo/jibx-users