[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Using <xsp:expr> into an attribute

Subject: Using <xsp:expr> into an attribute
From: Alessio Mazzieri <mazzieri@xxxxxxxxxxx>
Date: Mon, 26 Nov 2001 12:35:15 +0100
xsp expr
Hi to all.
I've this XML document (home.xml)

<?xml version="1.0"?>
<?cocoon-disable-caching ?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="templates/home.xsl" type="text/xsl"?>
<xsp:page language="java"
          xmlns:xsp="http://www.apache.org/1999/XSP/Core"
          xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
.
.
.

The XSP page process some DB Tables and populate the XML document with some nodes. In one node, I need to specify an attribute, with this code:

<xsp:content>
 <news>
  <xsl:attribute name="day">
   <xsp:expr>dateFormatter.format(todayLog)</xsp:expr>
  </xsl:attribute>
 </news>
</xsp:content>

But the generated XML document contanins explicitly
  <xsl:attribute name="day">
   <xsp:expr>2001-11-26</xsp:expr>
  </xsl:attribute>

and not, as I want,

<news day="2001-11-26"/>

I've tried with

<xsp:content>
 <news day="<xsp:expr>dateFormatter.format(todayLog)</xsp:expr>"/>
</xsp:content>

but this give me an error because I can't use "<" into the day attribute.
Any solution?

Thanks.


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.