Hi Frank,

Frank Hamilton schrieb:
I try make a rss reader in my publication with apache Rome.
I integrate Rome with lenya. In the java usecase handler get the content of
notice like:

List<String> lst = "<div > ... Notice1... </div>","<div > ... Notice1... </div>",...

I would strongly discourage this, since you're mixing business logic with layout.

then setParameter("lst",lst) and I need put this html code in my jx file.

Using <jx:macro tag
<jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml";>
        <jx:parameter name="list" />
        <jx:forEach var="item" items="${list}">
                        ${item}
        </jx:forEach>
</jx:macro>

<rss list="${usecase.getParameter('lst')}" />

But the xhtml result is :

 &lt;div &gt;&lt;img
src='http://infocar.dgt.es/etraffic/img/ICONenTABLAS/INCIDtablRETE.gif'
alt='RETENCION' title='RETENCION' class='ftl' /&gt;&lt;img ...

html entities apear in the code, i need write the <div tag ... to include in
xhtml page.

It´s possible pass the ${item} like a html code not like a text.

Can't you use something like this?

List<String> lst = "Notice1", "Notice2", …

<jx:macro name="rss" targetNamespace="http://www.w3.org/1999/xhtml";>
  <jx:parameter name="list" />
  <jx:forEach var="item" items="${list}">
    <div>${item}</div>
  </jx:forEach>
</jx:macro>

If you include the XML markup in the parameters, generating the view will be very difficult, since you have to apply subsequent transformations to parse the entities etc. I'd recommend to add all markup in the JX template or in XSLT transformations.

-- Andreas


--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
Tel.: +41 (0) 43 818 57 01


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to