You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Paul Madsen <pa...@coventus.com> on 2000/11/16 15:40:19 UTC

who has gotten HDML working?

I've tried the various recommendations made here previously and even
tried adapting HTMLSerializer but have been unable to get Cocoon to
output HDML. (I can get the HDML out but not as the appropriate mime)

There was a previous suggestion that specifying the TextFormatter for
x-hdml and then escaping the markup with CDATA would work. I don't mind
the kludginess but this didn't work for me the first time. Can someone
summarize the required pieces, e.g.

format for the 3? lines in cocoon.properties

formatter.type.text/x-hdml = org.apache.cocoon.formatter.TextFormatter
.
.
formatter.text/x-hdml.MIME-type = text/x-hdml
.
.
browser.9 = hdml=UP

and the processing instruction in the HDML XSL sheet.

Much appreciated

--
Paul Madsen




Re: who has gotten HDML working?

Posted by I-Chung Young <ic...@puma.mt.att.com>.
Hi,

	Here is what we did:

> format for the 3? lines in cocoon.properties
> 
> formatter.type.text/x-hdml = org.apache.cocoon.formatter.TextFormatter

formatter.type.text/hdml        =
org.apache.cocoon.formatter.TextFormatter

> formatter.text/x-hdml.MIME-type = text/x-hdml

formatter.text/hdml.MIME-type = text/x-hdml

> browser.9 = hdml=UP
> 
> and the processing instruction in the HDML XSL 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"
TTL="0">]]></xsl:text>
  <xsl:apply-templates/>
  <xsl:text><![CDATA[</HDML>]]></xsl:text>
 </page>
</xsl:template>

	You need a dummy tag (in my example, <page>) in order not
getting error of output text before element. This dummy tag will
be ignored in the output anyway due to TextFormatter.

	Generallly, you need to use enclose any tag ('<' or '>')
inside <xsl:text><![CDATA[  and  ]]></xsl:text>. Here is an example
(partial code from our apps. It is not pretty)

<xsl:template match="CONAMEGRP" mode="2">
 <xsl:text><![CDATA[<DISPLAY NAME="CONAMEGRP">
  <ACTION TYPE="ACCEPT"  LABEL="CONFIRM" TASK="GO"
DEST="]]></xsl:text><xsl:choose><xsl:when test="@DAY"><xsl:value-of
select="$tslisturl"/>?Closed=$(MCN)&amp;day=<xsl:value-of
select="@DAY"/>&amp;r=<xsl:value-of
select="$rand"/></xsl:when><xsl:otherwise><xsl:value-of
select="$tslisturl"/>?active=$(MCN)&amp;r=<xsl:value-of
select="$rand"/></xsl:otherwise></xsl:choose><xsl:text><![CDATA[">]]></xsl:text>

 <xsl:text><![CDATA[<LINE>]]></xsl:text>$(MCN)
 <xsl:text><![CDATA[<BR>]]></xsl:text>$(TKCNT)
 <xsl:text><![CDATA[<BR>]]></xsl:text>$(CONAME)
 <xsl:text><![CDATA[</DISPLAY>]]></xsl:text>

</xsl:template>

-- 
Thanks.
---------
I-Chung Young            Email: iyoung@att.com
Phone: 732-420-1078      B5-2C29, 200 Laurel Ave.
Fax:   732-368-1417      Middletown, NJ 07748