You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Robin Green <gr...@hotmail.com> on 2000/10/20 20:36:35 UTC

Re: May someone have a look at this (was: xinclude util-uri or what to do?)

Markus Spiekermann <Ma...@web.de> wrote:
>but I can´t get the DATA included...

What are you asking for - how to use XInclude? Have you looked at the 
XInclude samples? How to use util:include-uri? Have you looked at the FAQ? 
The source code?

It's not immediately clear what you're asking. Just saying "I can't do X" or 
"X is not working" is not always enough.

Also note that you can put the data into the <page> as normal, without using 
XInclude or util or anything like that! It's so simple!

>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/>   </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> <xsl:value-of select="name"/>:</b> 
>     </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---------------------------------------------------------------------------------]
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
>For additional commands, e-mail: cocoon-users-help@xml.apache.org
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


RE: May someone have a look at this (was: xinclude util-uri or what to do?)

Posted by Per Kreipke <pe...@onclave.com>.
> Hi,
> 
> I try to be more precice in the next mail. Sorry

How about just showing the flow without the Cocoon details, like so:

INPUT XML (source unclear):
<page>
  <porsche>
     <wheels>4</wheels>
     <hp>240</hp>
     <colors>
        <color name="white"/>
        <color name="blue"/>
     </colors>
  </porsche>
</page>

TRANSFORM XSL (dynamically chosen by URL query arg):

I'm trying to switch XSL sheets based on ...

OUTPUT (desired output is an HTML form):

I want to have 3 different forms, all cool and snazzy...

Per.   

> By the way: If I want to click on "cocoon" at 
> http://xml.apache.org to read the FAQ more
> precise I come to the "fop" page...
> 
> Markus
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 
> 

Re: May someone have a look at this (was: xinclude util-uri or what to do?)

Posted by Markus Spiekermann <Ma...@web.de>.
Hi,

I try to be more precice in the next mail. Sorry

By the way: If I want to click on "cocoon" at http://xml.apache.org to read the FAQ more
precise I come to the "fop" page...

Markus