Erik,

Yes, of course, and per the docs, 'Only the perl5 matcher accepts groups'

Thank you,
Hank


----- Original Message ----- 
From: "Erik Bruchez" <[EMAIL PROTECTED]>
To: "OXF Users" <[EMAIL PROTECTED]>
Sent: Friday, February 06, 2004 9:47 AM
Subject: Re: Creating default processing rules


> Hank,
> 
> I think the problem is that you are not defining any groups in your regexp. 
> Groups are defined with parentheses in the path-info attribute, for example 
> "/pre/(*.html)".
> 
> -Erik
> 
> Hank Ratzesberger wrote:
> 
> > Erik, et. al.,
> > 
> > Thank you.  Yes, this helps. And, I can see that what 
> > I am trying to do is very similar to the way the 
> > online doc's are handled.  However, I don't get the results
> > I want yet.  It only works if I put a specific filename
> > in my xforms.
> > 
> > Do I need to parse something out of a request processor?
> > I was expecting either the gob-matcher (which is all I 
> > need) or the perl5-matcher to pass some value in my param,
> > but I don't think it does.
> > 
> > Here is my controller:
> > 
> > <page id="test" path-info="/pre/*.html"
> >   matcher="oxf/processor/perl5-matcher"
> >   xforms="oxf:/preview.xml"
> >   model="oxf:/preview.xpl"> 
> >   <param ref="/form/path"/>
> > </page>
> > 
> > Here is my preview.xpl:
> > 
> > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline";>
> > 
> >   <p:param name="instance" type="input"/>
> > 
> >   <p:processor uri="oxf/processor/xslt-2.0">
> >     <p:input name="data" href="#instance"/>
> >     <p:input name="config">
> >       <config xsl:version="2.0" 
> >         xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> >         <url><xsl:value-of select="/form/path"/></url>
> >       </config>
> >     </p:input>
> >     <p:output name="data" id="url-config"/>
> >   </p:processor>
> > 
> >   <!-- Generate page -->
> >   <p:processor uri="oxf/processor/url-generator">
> >     <p:input name="config" href="#url-config"/>
> >     <p:output name="data" id="file"/>
> >   </p:processor>
> > 
> >   <!-- Transform the html into a stylesheet -->
> >   <p:processor uri="oxf/processor/xslt">
> >     <p:input name="config" href="/preview.xsl"/>
> >     <p:input name="data" href="#file"/>
> >     <p:output name="data" id="xsl"/>
> >   </p:processor>
> > 
> > ... 
> > 
> > Perhaps it's worth it to mention what I am trying to 
> > accomplish altogether.  I want to have a preview area
> > that a web designer using dreamweaver can create the
> > whole information architecture.  E.g., http://my.com/pre/
> > and all the pages there are xhtml pages.  To display 
> > these, I need to transform them to xsl so that I can 
> > merge (transform) with sample data.  The publishing 
> > phase involves moving the preview pages to their 
> > real locations, http://my.com/ , adjusting links (snip 'pre/')
> > and doing the first transform so they are already xsl.
> > The published pages are transformed against real data and
> > have complete controller rules.
> > 
> > Thanks greatly for any inputs,
> > Hank
> > 
> > 
> > ----- Original Message ----- 
> > From: "Erik Bruchez" <[EMAIL PROTECTED]>
> > To: "OXF Users" <[EMAIL PROTECTED]>
> > Sent: Thursday, February 05, 2004 12:02 PM
> > Subject: Re: Creating default processing rules
> > 
> > 
> > 
> >>Hi Hank,
> >>
> >>This is actually quite easy. The controller gives you the possibility
> >>to pass groups matched by the regexp matcher into the XForms
> >>instance. There is an example here:
> >>
> >>http://www.orbeon.com/oxf/doc/reference-controller#N10225
> >>
> >>So you have to create an XForms model, for example:
> >>
> >><xf:model xmlns:xf="http://www.w3.org/2002/xforms";>
> >>     <xf:instance>
> >>         <form>
> >>             <path/>
> >>         </form>
> >></xf:model>
> >>
> >>Then, pass the instance to your default.xpl:
> >>
> >><p:param name="instance" type="input"/>
> >>
> >>Then, you can access to the path with /form/path. What you probably
> >>want to do at that point is use the URL generator to create the local
> >>URL, for example:
> >>
> >><p:processor uri="oxf/processor/url-generator">
> >>     <p:input name="config" href="aggregate('config', 
> >>#instance#xpointer(concat('oxf:/', /form/path)))"/>
> >>     <p:output name="data" id="file"/>
> >></p:processor>
> >>
> >>What I am doing here in the input href is creating a configuration
> >>document for the URL generator. You may also do this with XSLT:
> >>
> >><p:processor uri="oxf/processor/xslt">
> >>     <p:input name="data" href="#instance"/>
> >>     <p:input name="config">
> >>         <xsl:stylesheet version="1.0" 
> >>xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> >>             <xsl:template match="/">
> >>                 <config><xsl:value-of select="/form/path"/></config>
> >>             </xsl:template>
> >>         </xsl:stylesheet>
> >>     </p:input>
> >>     <p:output name="data" id="url-config"/>
> >></p:processor>
> >>
> >>Which is even easier with XSLT 2.0:
> >>
> >><p:processor uri="oxf/processor/xslt-2.0">
> >>     <p:input name="data" href="#instance"/>
> >>     <p:input name="config">
> >>         <config xsl:version="2.0" 
> >>xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> >>             <xsl:value-of select="/form/path"/>
> >>         </config>
> >>     </p:input>
> >>     <p:output name="data" id="url-config"/>
> >></p:processor>
> >>
> >>You can reference the data by referring to href="#file" in a processor
> >>input.
> >>
> >>If the file is actually an HTML file, you will have to specify the
> >>content-type in the generator:
> >>
> >><p:processor uri="oxf/processor/xslt-2.0">
> >>     <p:input name="data" href="#instance"/>
> >>     <p:input name="config">
> >>         <config xsl:version="2.0" 
> >>xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> >>             <url><xsl:value-of select="/form/path"/></url>
> >>             <content-type>text/html</content-type>
> >>         </config>
> >>     </p:input>
> >>     <p:output name="data" id="url-config"/>
> >></p:processor>
> >>
> >>You have to use the URL generator because the input href="..." only
> >>support statically constructed references to either URLs
> >>(e.g. href="oxf:/myfile.html"), or references to processor outputs or
> >>pipeline inputs (e.g. href="#my-output").
> >>
> >>I hope this helps.
> >>
> >>-Erik
> >>
> >>Hank Ratzesberger wrote:
> >>
> >> > I would like to have a default pipeline get
> >> > applied to all files of the same type.  My
> >> > default pipleline converts the html to xsl, then
> >> > runs the xsl with a preferences xml file to get
> >> > site-wide defaults.
> >> >
> >> > All *.html files should have this two-step
> >> > processing, convert to XSL, transform with the
> >> > preferences XML file.
> >> >
> >> > I guess the problem is I don't know how to
> >> > reference the file the controller is looking at,
> >> > that is, what is the local directory for the file?
> >> > I need to pass that url as the data input to
> >> > my first processor statement.
> >> >
> >> > (BTW, is the html serializer necessary?)
> >> >
> >> > Thanks for any tips.
> >> > --Hank
> >> >
> >> > ============================================
> >> > Replying to a list?  I'll get my copy there!
> >> >
> >> > Hank Ratzesberger
> >> > http://crustal.ucsb.edu/ | http://neesgrid.org/
> >> > Institute for Crustal Studies
> >> > University of California, Santa Barbara
> >> > ============================================
> >> >
> >> >
> >> >
> >> >
> >> > Snippet from controller.xml:
> >> >
> >> > <page path-info="/(*.html)"
> >> >     matcher="oxf/processor/perl5-matcher"
> >> >     model="oxf:/default.xpl">
> >> > </page>
> >> >
> >> >
> >> > default.xpl:
> >> >
> >> >
> >> > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline";>
> >> >
> >> >   <!-- Transform the xhtml into a stylesheet -->
> >> >   <!-- This step is only for preview pages -->
> >> >
> >> >  <p:processor uri="oxf/processor/xslt">
> >> >   <p:input name="config" href="./index.xsl"/>
> >> > <!-- WHERE IS THIS URL? THE ONE GETTING EVALUATED IN CONTROLLER.XML? -->
> >> >   <p:input name="data" href="./index.html"/>
> >> >   <p:output name="data" id="xsl"/>
> >> >  </p:processor>
> >> >
> >> >
> >> >  <!-- Process xml data with stylesheet.  All inputs are aggregated under 
> >>/root -->
> >> >
> >> >  <p:processor uri="oxf/processor/xslt">
> >> >   <p:input name="config" href="#xsl"/>
> >> >   <p:input name="data" href="aggregate('root', /site-prefs.xml)"/>
> >> >   <p:output name="data" id="data"/>
> >> >  </p:processor>
> >> >
> >> >
> >> >  <!-- Deliver html -->
> >> >
> >> >  <p:processor uri="oxf/processor/html-serializer">
> >> >   <p:input name="config">
> >> >    <config/>
> >> >   </p:input>
> >> >   <p:input name="data" href="#data"/>
> >> >  </p:processor>
> >> >
> >> > </p:config>
> >> >
> >> >
> >> > _______________________________________________
> >> > oxf-users mailing list
> >> > [EMAIL PROTECTED]
> >> > http://mail.orbeon.com/mailman/listinfo/oxf-users
> >>
> >>
> >>_______________________________________________
> >>oxf-users mailing list
> >>[EMAIL PROTECTED]
> >>http://mail.orbeon.com/mailman/listinfo/oxf-users
> > 
> > _______________________________________________
> > oxf-users mailing list
> > [EMAIL PROTECTED]
> > http://mail.orbeon.com/mailman/listinfo/oxf-users
> 
> _______________________________________________
> oxf-users mailing list
> [EMAIL PROTECTED]
> http://mail.orbeon.com/mailman/listinfo/oxf-users
_______________________________________________
oxf-users mailing list
[EMAIL PROTECTED]
http://mail.orbeon.com/mailman/listinfo/oxf-users

Reply via email to