XSLT

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

XSLT

Peymirat Damien
Hi all,


   I'm trying to build an xi:include dynamically in model.xpl and return
this xi:include in "instance". So I have done this code :

        <p:processor name="oxf:xslt">
                <p:input name="data" href="#input"/>
                <p:input name="config">
                        <config xsl:version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       
<projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of
select="string(/)"/>
                                </projet>
                        </config>
                </p:input>
                <p:output name="data" id="aaa"/>
        </p:processor>
        <p:processor name="oxf:xslt">
                <p:input name="data" href="#aaa"/>
                <p:input name="config">
                        <config xsl:version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                                <xi:include href="{/config/projet}"
xmlns:saxon="http://saxon.sf.net/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/>
                        </config>
                </p:input>
                <p:output name="data" id="output"/>
        </p:processor>
        <p:processor name="oxf:identity">
                <p:input name="data" href="#output"/>
                <p:output name="data" ref="formatted-output"/>
        </p:processor>
</p:config>


However, when I try to acces the value of formatted-output like this :
<xforms:output
ref="/form/formatted-output/config/exist:result/exist:collection/exist:c
ollection/@name"/> I have no result. Do you have an idea ???

Thank you

Damien.



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE : XSLT

Peymirat Damien
I have found another solution, but I need your help again :

I would like to dynamically build the input name="config" in the processor oxf:xinclude. I know that I can do this with XSLT but I can't see how to build the attribute href ...

<p:processor name="oxf:xinclude">
        <p:input name="config" href="  "/>
        <p:output name="data" id="result"/>
</p:processor>


Thank you very much

Damien.


-----Message d'origine-----
De : Peymirat Damien [mailto:[hidden email]]
Envoyé : lundi 7 août 2006 13:46
À : [hidden email]
Objet : [ops-users] XSLT


Hi all,


   I'm trying to build an xi:include dynamically in model.xpl and return this xi:include in "instance". So I have done this code :

        <p:processor name="oxf:xslt">
                <p:input name="data" href="#input"/>
                <p:input name="config">
                        <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
       
<projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of
select="string(/)"/>
                                </projet>
                        </config>
                </p:input>
                <p:output name="data" id="aaa"/>
        </p:processor>
        <p:processor name="oxf:xslt">
                <p:input name="data" href="#aaa"/>
                <p:input name="config">
                        <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                                <xi:include href="{/config/projet}" xmlns:saxon="http://saxon.sf.net/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/>
                        </config>
                </p:input>
                <p:output name="data" id="output"/>
        </p:processor>
        <p:processor name="oxf:identity">
                <p:input name="data" href="#output"/>
                <p:output name="data" ref="formatted-output"/>
        </p:processor>
</p:config>


However, when I try to acces the value of formatted-output like this : <xforms:output ref="/form/formatted-output/config/exist:result/exist:collection/exist:c
ollection/@name"/> I have no result. Do you have an idea ???

Thank you

Damien.




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XSLT

Erik Bruchez
Administrator
In reply to this post by Peymirat Damien
Damien,

You have to be careful about the order in which XInclude is processed:
the PFC automatically applies XInclude processing to models and views,
so your xi:include are processed when model.xpl is loaded, not after.
However if you externalize your XSLT code into a separate file, things
should work better.

-Erik

Peymirat Damien wrote:

> Hi all,
>
>
>    I'm trying to build an xi:include dynamically in model.xpl and return
> this xi:include in "instance". So I have done this code :
>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#input"/>
> <p:input name="config">
> <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of
> select="string(/)"/>
> </projet>
> </config>
> </p:input>
> <p:output name="data" id="aaa"/>
> </p:processor>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#aaa"/>
> <p:input name="config">
> <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xi:include href="{/config/projet}"
> xmlns:saxon="http://saxon.sf.net/"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/>
> </config>
> </p:input>
> <p:output name="data" id="output"/>
> </p:processor>
> <p:processor name="oxf:identity">
> <p:input name="data" href="#output"/>
> <p:output name="data" ref="formatted-output"/>
> </p:processor>
> </p:config>
>
>
> However, when I try to acces the value of formatted-output like this :
> <xforms:output
> ref="/form/formatted-output/config/exist:result/exist:collection/exist:c
> ollection/@name"/> I have no result. Do you have an idea ???
>
> Thank you
>
> Damien.
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: RE : XSLT

Erik Bruchez
Administrator
In reply to this post by Peymirat Damien
In short, you can't unless you are to generate an entire pipeline
dynamically e.g. with XSLT. But I don't think you need this anyway if
all you want is to produce a dynamic XInclude configuration: just feed
the output of your XSLT transformation to oxf:include's config input.

-Erik

Peymirat Damien wrote:

> I have found another solution, but I need your help again :
>
> I would like to dynamically build the input name="config" in the processor oxf:xinclude. I know that I can do this with XSLT but I can't see how to build the attribute href ...
>
> <p:processor name="oxf:xinclude">
> <p:input name="config" href="  "/>
> <p:output name="data" id="result"/>
> </p:processor>
>
>
> Thank you very much
>
> Damien.
>
>
> -----Message d'origine-----
> De : Peymirat Damien [mailto:[hidden email]]
> Envoyé : lundi 7 août 2006 13:46
> À : [hidden email]
> Objet : [ops-users] XSLT
>
>
> Hi all,
>
>
>    I'm trying to build an xi:include dynamically in model.xpl and return this xi:include in "instance". So I have done this code :
>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#input"/>
> <p:input name="config">
> <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of
> select="string(/)"/>
> </projet>
> </config>
> </p:input>
> <p:output name="data" id="aaa"/>
> </p:processor>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#aaa"/>
> <p:input name="config">
> <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xi:include href="{/config/projet}" xmlns:saxon="http://saxon.sf.net/"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/>
> </config>
> </p:input>
> <p:output name="data" id="output"/>
> </p:processor>
> <p:processor name="oxf:identity">
> <p:input name="data" href="#output"/>
> <p:output name="data" ref="formatted-output"/>
> </p:processor>
> </p:config>
>
>
> However, when I try to acces the value of formatted-output like this : <xforms:output ref="/form/formatted-output/config/exist:result/exist:collection/exist:c
> ollection/@name"/> I have no result. Do you have an idea ???
>
> Thank you
>
> Damien.
>
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XSLT

Florent Georges
In reply to this post by Erik Bruchez
Erik Bruchez wrote:

  Hi

> Peymirat Damien wrote:

> > <config xsl:version="2.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> > <xi:include href="{/config/projet}"
> > xmlns:saxon="http://saxon.sf.net/"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> xsl:version="2.0"/>
> > </config>

> so your xi:include are processed when model.xpl is loaded,
> not after.

> However if you externalize your XSLT code into a separate
> file, things should work better.

  I didn't follow the whole discussion, but if the goal is
to make XSLT generating an xi:include element (instead of
this element being "resolved" before actually executing the
XSLT script), it would be enough to use xsl:element:

    <xsl:element name="xi:include" xmlns:xi="...">
      <xsl:attribute name="href" select="/config/projet"/>
    </xsl:element>

  Regards,

--drkm
























       

       
               
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XSLT

Erik Bruchez
Administrator
Florent Georges wrote:

>   I didn't follow the whole discussion, but if the goal is
> to make XSLT generating an xi:include element (instead of
> this element being "resolved" before actually executing the
> XSLT script), it would be enough to use xsl:element:
>
>     <xsl:element name="xi:include" xmlns:xi="...">
>       <xsl:attribute name="href" select="/config/projet"/>
>     </xsl:element>

Yes, that should work too!

You could also use:

<xsl:namespace-alias stylesheet-prefix="xi1" result-prefix="xi"/>

with xi1 mapping to a random namespace and xi pointing to the regular
XInclude namespace.

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: XSLT

Florent Georges
Erik Bruchez wrote:

> Florent Georges wrote:

> >     <xsl:element name="xi:include" xmlns:xi="...">
> >       <xsl:attribute name="href" select="/config/projet"/>
> >     </xsl:element>

> Yes, that should work too!

> You could also use:

> <xsl:namespace-alias stylesheet-prefix="xi1" result-prefix="xi"/>

  Yes, even clearer :-)

  Regards,

--drkm





















       

       
               
___________________________________________________________________________
Découvrez un nouveau moyen de poser toutes vos questions quelque soit le sujet !
Yahoo! Questions/Réponses pour partager vos connaissances, vos opinions et vos expériences.
http://fr.answers.yahoo.com 




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE : XSLT

Peymirat Damien
In reply to this post by Peymirat Damien

Thank you Erik

So I decided to save my include in a document and include this document in my view. However I still have a problem. I don't have the same result if I put the output of my oxf:xslt in oxf:include's config input or if I directly put an URI in oxf:include's config input.

For example,

<p:processor name="oxf:xinclude">
<p:input name="config" href="#aaa#xpointer(/config/projet)"/>

and

<p:processor name="oxf:xinclude">
<p:input name="config" href="http://localhost:8080/exist/rest//db/sxmldb/Pleiade"/>

give me two differents result :

Result 1 :

<projet>http://localhost:8080/exist/rest//db/sxmldb/Pleiade</projet>

Result 2 : the good result, (i.e the include of the xml file http://localhost:8080/exist/rest//db/sxmldb/Pleiade


Here is my code :

<p:processor name="oxf:xslt">
  <p:input name="data" href="#input"/>
  <p:input name="config">
    <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <projet>
        http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of select="string(/)"/>
      </projet>
    </config>
  </p:input>
<p:output name="data" id="aaa"/>
</p:processor>

<p:processor name="oxf:xinclude">
<p:input name="config" href="#aaa#xpointer(/config/projet)"/>
<p:output name="data" id="result"/>
</p:processor>



Thank you very much for your help

Best regards

Damien.




-----Message d'origine-----
De : Erik Bruchez [mailto:[hidden email]] De la part de Erik Bruchez
Envoyé : lundi 7 août 2006 18:38
À : [hidden email]
Objet : Re: [ops-users] XSLT


Damien,

You have to be careful about the order in which XInclude is processed:
the PFC automatically applies XInclude processing to models and views,
so your xi:include are processed when model.xpl is loaded, not after.
However if you externalize your XSLT code into a separate file, things
should work better.

-Erik

Peymirat Damien wrote:

> Hi all,
>
>
>    I'm trying to build an xi:include dynamically in model.xpl and
> return this xi:include in "instance". So I have done this code :
>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#input"/>
> <p:input name="config">
> <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of
> select="string(/)"/>
> </projet>
> </config>
> </p:input>
> <p:output name="data" id="aaa"/>
> </p:processor>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#aaa"/>
> <p:input name="config">
> <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xi:include href="{/config/projet}"
> xmlns:saxon="http://saxon.sf.net/"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/>
> </config>
> </p:input>
> <p:output name="data" id="output"/>
> </p:processor>
> <p:processor name="oxf:identity">
> <p:input name="data" href="#output"/>
> <p:output name="data" ref="formatted-output"/>
> </p:processor>
> </p:config>
>
>
> However, when I try to acces the value of formatted-output like this :
> <xforms:output
> ref="/form/formatted-output/config/exist:result/exist:collection/exist
> :c
> ollection/@name"/> I have no result. Do you have an idea ???
>
> Thank you
>
> Damien.
>
>
>
> ----------------------------------------------------------------------
> --
>
>
> --
> You receive this message as a subscriber of the
> [hidden email] mailing list. To unsubscribe:
> mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE : RE : XSLT

Peymirat Damien
OK I found the solution !!

Thank you Erik and Florent for your help

Here is my solution

<p:processor name="oxf:xslt">
        <p:input name="data" href="#input"/>
        <p:input name="config">
                <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                        <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of select="string(/)"/>
                        </projet>
                </config>
        </p:input>
        <p:output name="data" id="aaa"/>
</p:processor>

<p:processor name="oxf:xslt">
        <p:input name="data" href="#aaa"/>
        <p:input name="config">
                <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
                        <xi:include href="{/config/projet}" xmlns:saxon="http://saxon.sf.net/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/>
                </config>
        </p:input>
        <p:output name="data" id="output_xslt"/>
</p:processor>

<p:processor name="oxf:xinclude">
        <p:input name="config" href="#output_xslt"/>
        <p:output name="data" id="result"/>
</p:processor>





-----Message d'origine-----
De : Peymirat Damien [mailto:[hidden email]]
Envoyé : mardi 8 août 2006 10:30
À : [hidden email]
Objet : RE : [ops-users] XSLT



Thank you Erik

So I decided to save my include in a document and include this document in my view. However I still have a problem. I don't have the same result if I put the output of my oxf:xslt in oxf:include's config input or if I directly put an URI in oxf:include's config input.

For example,

<p:processor name="oxf:xinclude">
<p:input name="config" href="#aaa#xpointer(/config/projet)"/>

and

<p:processor name="oxf:xinclude">
<p:input name="config" href="http://localhost:8080/exist/rest//db/sxmldb/Pleiade"/>

give me two differents result :

Result 1 :

<projet>http://localhost:8080/exist/rest//db/sxmldb/Pleiade</projet>

Result 2 : the good result, (i.e the include of the xml file http://localhost:8080/exist/rest//db/sxmldb/Pleiade


Here is my code :

<p:processor name="oxf:xslt">
  <p:input name="data" href="#input"/>
  <p:input name="config">
    <config xsl:version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <projet>
        http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of select="string(/)"/>
      </projet>
    </config>
  </p:input>
<p:output name="data" id="aaa"/>
</p:processor>

<p:processor name="oxf:xinclude">
<p:input name="config" href="#aaa#xpointer(/config/projet)"/>
<p:output name="data" id="result"/>
</p:processor>



Thank you very much for your help

Best regards

Damien.




-----Message d'origine-----
De : Erik Bruchez [mailto:[hidden email]] De la part de Erik Bruchez Envoyé : lundi 7 août 2006 18:38 À : [hidden email] Objet : Re: [ops-users] XSLT


Damien,

You have to be careful about the order in which XInclude is processed:
the PFC automatically applies XInclude processing to models and views,
so your xi:include are processed when model.xpl is loaded, not after.
However if you externalize your XSLT code into a separate file, things
should work better.

-Erik

Peymirat Damien wrote:

> Hi all,
>
>
>    I'm trying to build an xi:include dynamically in model.xpl and
> return this xi:include in "instance". So I have done this code :
>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#input"/>
> <p:input name="config">
> <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
>
> <projet>http://localhost:8080/exist/rest//db/sxmldb/<xsl:value-of
> select="string(/)"/>
> </projet>
> </config>
> </p:input>
> <p:output name="data" id="aaa"/>
> </p:processor>
> <p:processor name="oxf:xslt">
> <p:input name="data" href="#aaa"/>
> <p:input name="config">
> <config xsl:version="2.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xi:include href="{/config/projet}"
> xmlns:saxon="http://saxon.sf.net/"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"/>
> </config>
> </p:input>
> <p:output name="data" id="output"/>
> </p:processor>
> <p:processor name="oxf:identity">
> <p:input name="data" href="#output"/>
> <p:output name="data" ref="formatted-output"/>
> </p:processor>
> </p:config>
>
>
> However, when I try to acces the value of formatted-output like this :
> <xforms:output
> ref="/form/formatted-output/config/exist:result/exist:collection/exist
> :c
> ollection/@name"/> I have no result. Do you have an idea ???
>
> Thank you
>
> Damien.
>
>
>
> ----------------------------------------------------------------------
> --
>
>
> --
> You receive this message as a subscriber of the
> [hidden email] mailing list. To unsubscribe:
> mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws