You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Mark Donnelly <ma...@strategixsoftware.com> on 2005/01/12 16:03:00 UTC

Wildcards

Im trying to use specify the file name of the XML doc in the URL. Ive read a
bit about Matchers and am trying to get the correct pattern selected using
the following:

My URL:

http://localhost:7080/cocoon3/df/order/5555

My pipeline:

    <map:match pattern="order/*">

      <!--+
          | Start generating SAX events inside the pipeline. In this case,
          | since no "type" attribute is specified, the default generator
          | is used and this is a regular XML parser that reads the
          | given file from the URL included in the "src" attribute and
          | sends the events produced by the parser down the pipeline to
          | be processed by the next stage.
          +-->
      <map:generate src="C:\\{1}"/>

      <!--+
          | This transformer gets the input SAX events and transforms them
          | using the default transformer (the XSLT transformer) thus
          | applying the XSLT stylesheet indicated in the "src" attribute
          | and sending the output down the pipeline to be processed by the
          | next stage.
          +-->
      <map:transform src="C:\Documents and Settings\mdon\My
Documents\foreports\order.xsl">
        <map:parameter name="contextPath" value="{request:contextPath}"/>
      </map:transform>

      <!--+
          | The serializer concludes the SAX events journey into the
pipeline
          | since it serializes the events it receives into a representation
          | depending on the serializer type. Here we choose the "XHMTL"
          | serializer, which will produce an XHTML representation of the
          | SAX stream.
          +-->
      <map:serialize type="fo2pdf"/>
    </map:match>

The response I get from Cocoon:

C:\{1} (The system cannot find the file specified)
Note that if I hard code in the path then I get the desired result but I
want something that is going to be more dynamic.
Any ideas on what Im doing wrong so that {1} is not expanding to be 5555?

Mark


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


Re: Wildcards

Posted by Jean-Christophe Kermagoret <jc...@babelobjects.com>.
Hello,
you can try several things.

First, you backslash {, so the parameter is maybe misunderstood.
Try :

      <map:generate src="C:/{1}"/>

You can try too :

      <map:generate src="file://C:/{1}"/>

But the best way would be :

      <map:generate src="docs/{1}"/>

and put your docs in order/docs

so your application would be more portable.

HTH

Mark Donnelly a écrit :

>Im trying to use specify the file name of the XML doc in the URL. Ive read a
>bit about Matchers and am trying to get the correct pattern selected using
>the following:
>
>My URL:
>
>http://localhost:7080/cocoon3/df/order/5555
>
>My pipeline:
>
>    <map:match pattern="order/*">
>
>      <!--+
>          | Start generating SAX events inside the pipeline. In this case,
>          | since no "type" attribute is specified, the default generator
>          | is used and this is a regular XML parser that reads the
>          | given file from the URL included in the "src" attribute and
>          | sends the events produced by the parser down the pipeline to
>          | be processed by the next stage.
>          +-->
>      <map:generate src="C:\\{1}"/>
>
>      <!--+
>          | This transformer gets the input SAX events and transforms them
>          | using the default transformer (the XSLT transformer) thus
>          | applying the XSLT stylesheet indicated in the "src" attribute
>          | and sending the output down the pipeline to be processed by the
>          | next stage.
>          +-->
>      <map:transform src="C:\Documents and Settings\mdon\My
>Documents\foreports\order.xsl">
>        <map:parameter name="contextPath" value="{request:contextPath}"/>
>      </map:transform>
>
>      <!--+
>          | The serializer concludes the SAX events journey into the
>pipeline
>          | since it serializes the events it receives into a representation
>          | depending on the serializer type. Here we choose the "XHMTL"
>          | serializer, which will produce an XHTML representation of the
>          | SAX stream.
>          +-->
>      <map:serialize type="fo2pdf"/>
>    </map:match>
>
>The response I get from Cocoon:
>
>C:\{1} (The system cannot find the file specified)
>Note that if I hard code in the path then I get the desired result but I
>want something that is going to be more dynamic.
>Any ideas on what Im doing wrong so that {1} is not expanding to be 5555?
>
>Mark
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>  
>


-- 

Jean-Christophe Kermagoret
jck@BabelObjects.Com



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