Hi,

I have written a small XSP-file to dynamically include articles from a
news.xml-file, based on the current date (so as to leave out articles that
have expired).
I use the xml:base tag to point to my data-directory, and I use XInclude to
include the relevant news-articles from there.

The problem I'm having is that the xml:base attribute results in a
"xmlns:xml"-attribute in the resulting file, which is illegal...

What am I doing wrong, how can I fix this?

The result:
<news xml:base="cocoon:/data/"
xmlns:xml="http://www.w3.org/XML/1998/namespace";>
...
</news>

The original XSP:

<?xml version="1.0" encoding="ISO-8859-1"?>

<xsp:page
 language="java"
 xmlns:xsp="http://apache.org/xsp";
 xmlns:xi="http://www.w3.org/2001/XInclude";>

 <xsp:structure>
  <xsp:include>java.text.SimpleDateFormat</xsp:include>
 </xsp:structure>

 <news xml:base="cocoon:/data/">
  <xsp:logic>
   Date today = new Date();
   String strToday = (new SimpleDateFormat("yyyyMMdd")).format(today);
  </xsp:logic>

  <xi:include>
   <xsp:attribute name="href">news.xml#xpointer(//article[
(translate(@date,'-', '') &lt;= <xsp:expr>strToday</xsp:expr>) and
(translate(@expires,'-', '') &gt;=
<xsp:expr>strToday</xsp:expr>) ])</xsp:attribute>
  </xi:include>
 </news>
</xsp:page>

Kind regards,

Koen Pellegrims


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to