cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Spiekermann <Markus.Spiekerm...@web.de>
Subject May someone have a look at this (was: xinclude util-uri or what to do?)
Date Fri, 20 Oct 2000 17:02:30 GMT
Hi,

i know there have been several dicussions about this but I still can´t
find  a working solution for this.

Problem

I need a page where I can select an xml-File (porsche911.XML for
example) and select the style (eg. display only mechanical
information.XSL).
This portion seems to work (parameters are passed in the URL). The
submit-button triggers the page "show.xml" which shall now include the
selected xml-file and of course shall be styled in the desired way. At
the moment I´m able to switch between different stylings (thanks to the
list), but I can´t get the DATA included...
Please help..

Thanks



[------------------- Show.xml ----- not working !!!!
------------------------------------]
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<xsp:page language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">
 <xsp:logic>
  <xsp:pi
target="xml-stylesheet">href="<xsp:expr>request.getParameter("stylesheet")</xsp:expr>"

type="text/xsl"</xsp:pi>
  <!--SOMETHING WRONG HERE?- HOW CAN I INCLUDE THE CAR.XML files e.G.
ferraritestarossa.xml?->
  <xsp:pi
target="cocoon-process">href="<xsp:expr>request.getParameter("project")</xsp:expr>"

type="text/xslt"</xsp:pi>
 </xsp:logic>
 <page>Car page</page>
</xsp:page>

[---
End---------------------------------------------------------------------------------]

These things seem to work...
[--- choose_car_information.xml-----------------------]

<?xml version="1.0"?>
<?cocoon-process type="xslt"?>
<?xml-stylesheet href="page.xsl" type="text/xsl"?>
<page>
 <h1>Please select </h1>
 <form url="show.xml">
  <formselect>
   <name>Car</name>
   <param>project</param>
   <entry>Ferrari Testarossa</entry>
   <entry>Porsche 911</entry>
   <entry>BMW Z8</entry>
  </formselect>
  <formselect>
   <name>Information</name>
   <param>stylesheet</param>
   <entry>mechanical.xsl</entry>
   <entry>electronic.xsl</entry>
   <entry>environmental.xsl</entry>
  </formselect>
 </form>
</page>
[---
End---------------------------------------------------------------------------------]

[--- page.xsl---originaly form Uli Maying]
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:variable name="yellow">#FFCC33</xsl:variable>
<xsl:template match="page">
 <html>
  <head>
   <title>
    <xsl:value-of select="//titel"/>
   </title>
  </head>
  <body>
   <xsl:apply-templates/>
  </body>
 </html>
</xsl:template>
<xsl:template match="title">
 <table border="0" cellpadding="0" cellspacing="0">
  <tr>
   <td>
    <h1><xsl:apply-templates/>&#160;&#160;&#160;</h1>
   </td>
   </tr>
 </table>
</xsl:template>
<xsl:template match="form">
 <form action="{@url}" method="GET">
  <table border="0" cellpadding="0" cellspacing="3">
   <xsl:apply-templates/>
   <tr><td colspan="2" align="right">
   <input type="submit"></input>
   </td></tr>
  </table>
 </form>
</xsl:template>
<xsl:template match="formselect">
 <tr>
  <td align="right" valign="middle" bgcolor="{$yellow}" width="25%">
   <b>&#160;<xsl:value-of select="name"/>:</b>&#160;
   &#160;</td>
  <td align="left">
   <select name="{param}" size="1">
    <xsl:for-each select="entry">
     <option value="{.}"><xsl:value-of select="."/></option>
    </xsl:for-each>
   </select>
  </td>
 </tr>
</xsl:template>
<xsl:template match="*">
 <xsl:apply-templates/><br/>
</xsl:template>
</xsl:stylesheet>
[---
End---------------------------------------------------------------------------------]





Mime
View raw message