You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Steven Maring <St...@trcinc.com> on 2000/04/08 16:33:39 UTC

RE: tough XSL in logicsheet problem - Xalan, DOCTYPEs, ENTITYs, a nd xsl:output

Yeah, I think I understand what you are doing.  I don't really have a
problem with PIs.  I need the XML that the logicsheet generates to contain a
<!DOCTYPE> reference to a DTD that has entity definitions, and then have
entity references in the XML.  I need this to load template data.

I can't do a <xsl:text> because that causes Cocoon to generate a producer
that thinks my <!DOCTYPE> is a text node!

The XSLT spec says that you should use <xsl:output>.  So I tried this is my
logicsheet:

  <xsl:template match="page">
    <xsl:processing-instruction
name="cocoon-process">type="xsp"</xsl:processing-instruction>

      <xsl:output 
           method-type="xml"
 
doctype-system="http://localhost/modelSystem/templates/entityrefs.dtd" 
      />

      <xsp:page xmlns:xsp="http://www.apache.org/1999/XSP/Core">
	<page>
	  &#38;template_data;   <!-- not to sure 'bout this either -->
             <xsp:logic>
                ...

Where the DTD just contains:

<?xml version="1.0"?>
<!ENTITY template_data SYSTEM
"http://localhost/modelSystem/templates/template_xml.txt">


But running this throws these:

org.apache.xalan.xslt.XSLProcessorException: Unknown XSL element: output
at org.apache.xalan.xslt.XSLTEngineImpl.error(XSLTEngineImpl.java, Compiled
Code)

and

org.xml.sax.SAXException: Unknown XSL element: output
at
org.apache.xalan.xslt.StylesheetHandler.startElement(StylesheetHandler.java,
Compiled Code)


Which almost sounds like it could be a bug in Xalan_1_0_0.  But I did find
reference to a similar usage in the xalan-dev list archive, so I really
don't know.



--Steve Maring






-----Original Message-----
From: Robin Green
To: cocoon-users@xml.apache.org
Sent: 4/8/00 10:54 AM
Subject: RE: tough XSL in logicsheet problem

I've seen this before. Hmmmm... how did I fix it?

AFAIK, you can't do this:

<xsl:template match="/">
  blah blah
  <xsl:apply-templates />
</xsl:template>

because you have to wait until the / is outputted before you can output 
"blah blah". I know, it sucks. My workaround is as follows: I know what
the 
"root element" is (that's different to the "document root" I think - am
I 
right?), so let's say it's "page". Then do:

<xsl:template match="page">
  blah blah
  <xsl:apply-templates />
</xsl:template>

This pattern works in my stylesheets (it outputs PIs before the "page" 
element as expected), using Cocoon 1.7.2.

Question is, is this a bug in Xalan, or are we both confused about
document 
roots?


______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org