cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From I-Chung Young <ich...@puma.mt.att.com>
Subject Re: Cocoon and dynamic HDML (re-post)
Date Fri, 01 Dec 2000 13:57:59 GMT
Paul,

	I can't reproduce your problem. I use an example

<doc>
<select>
 <option param="1">1</option>
 <option param="2">2</option>
</select>
</doc>

	with style-sheet

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
 <xsl:processing-instruction name="cocoon-format">
 type="text/hdml"
 </xsl:processing-instruction>
<page>
<xsl:text><![CDATA[<HDML VERSION="3.1" PUBLIC="TRUE">]]></xsl:text>
<xsl:apply-templates/>
<xsl:text><![CDATA[</HDML>]]></xsl:text>
</page>
</xsl:template>

<xsl:template match="select">
<xsl:text><![CDATA[<CHOICE TITLE="Test" IKEY="option"
KEY="op">]]></xsl:text>
 <xsl:apply-templates select="option"/>
<xsl:text><![CDATA[</CHOICE>]]></xsl:text>
</xsl:template>

<xsl:template match="option">
<xsl:text><![CDATA[<ce value="]]></xsl:text><xsl:value-of
select="@param"/><xsl:text><![CDATA[">]]></xsl:text><xsl:value-of
select="."/>   
</xsl:template>

</xsl:stylesheet>

	and output as 

<HDML VERSION="3.1" PUBLIC="TRUE">
<CHOICE TITLE="Test" IKEY="option" KEY="op"><ce value="1">1<ce 
value="2">2</CHOICE>
</HDML>

	There is no error even all <CE> are in the same line.
I think the problem is HDML syntax error somewhere else.
(I assume you are using UP.simpulator)

-------
I-Chung

> I'm using Cocoon to create HDML through the 'kluge' of using
> TextFormatter and wrapping my output HDML in
> <xsl:text><!CDATA[         ]]></xsl:text> .
> 
> I am trying to dynamically build a choice list, e.g. output HDML that
> looks like (ignoring required attributes)
> 
> <hdml>
> <choice>
>     <ce value="1">1
>     <ce value="2">2
> </choice>
> </hdml>
> 
> I need to extract the <ce> elements attribute value and content from my
> source XML but the CDATA tags prevent me from doing so using
> <xsl:attribute> so I must build up the HDML as strings, e.g. for source
> XML like
> 
> .
> <option param="1">1</option>
> <option param="2">2</option>
> .
> 
> I've been trying the following XSL (there are no linebreaks in the
> stylesheet)
> 
> <xsl:template match="option">
> <xsl:text><![CDATA[<ce value="]]></xsl:text><xsl:value-of
> select="@param"/><xsl:text><![CDATA[">]]></xsl:text><xsl:value-of
> select="."/>
> </xsl:template>
> 
> While this builds HDML that appears fine (looking at the generated HDML
> through an emulators view source), the emulator itself complains that
> '<CE> can have only one line of formatted text' which suggests to me
> that the emulator is not seeing the line breaks that I see looking at
> the source.
> 
> I appreciate any insight.
> 
> Paul
> 
> --
> Paul Madsen
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> 


Mime
View raw message