Re: Orbeon PresentationServer ???

"COUTHURES Alain" <[email protected]>
Newsgroups gmane.text.xml.french.tech
Message-ID <5793851076333E46B644F9CE85AFDBCD6DBF6C@mail-enm-bdx.enm.justice.fr>
Erik, 

> Ce serait interessant de comparer des scenarios d'utilisation concrets (use cases) entre cette methode et des methodes
> disons plus classiques, comme celles utilisees par XProc, en particulier construction for-each et "viewports":

Voici ce que j'ai pu faire tourner sur le sujet :

>   http://www.w3.org/TR/2006/WD-xproc-20060928/#c.for-each

En paramètre : 
<sequence>
 <docbook-chapter filename="chap1.docbook"/>
 <docbook-chapter filename="chap2.docbook"/>
 <docbook-chapter filename="chap3.docbook"/>
</sequence>

Le script :
<xdg:scriptsheet version="0.4" xmlns:xdg="http://www.enm.justice.fr/xdg">
 <xdg:stylesheet name="main">
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:xdg="http://www.enm.justice.fr/xdg">
   <xsl:template match="/">
    <xdg:save filename="result-for-each.xml" format="xml">
     <sequence>
      <xsl:for-each select="/sequence/docbook-chapter">
       <xdg:transform stylesheet="format-chapter">
        <xdg:load filename="{@filename}" format="xml"/>
       </xdg:transform>
      </xsl:for-each>
     </sequence>
    </xdg:save>
   </xsl:template>
  </xsl:stylesheet>
 </xdg:stylesheet>
 <xdg:stylesheet name="format-chapter">
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:xdg="http://www.enm.justice.fr/xdg">
   <xsl:template match="/">
    <h1><xsl:value-of select="/chapter/title"/></h1>
   </xsl:template>
  </xsl:stylesheet>
 </xdg:stylesheet>
</xdg:scriptsheet>

En résultat :
<sequence>
 <h1>Premier chapitre</h1>
 <h1>Deuxieme chapitre</h1>
 <h1>Troisieme chapitre</h1>
</sequence>

>   http://www.w3.org/TR/2006/WD-xproc-20060928/#c.viewport

(J'ai assumé que le cryptage était accessible par service web et qu'il retournait quelque chose comme <string>...</string>)

En paramètre :
<html>
 <head>
  <title>Viewport Test</title>
 </head>
 <body>
  <h1>Viewport test</h1>
  <div selected="true">Texte a cacher</div>
  <div>Texte simple</div>
  <div selected="true">Texte a cacher</div>
  <p>Fin</p>
 </body>
</html>

Le script :
<xdg:scriptsheet version="0.4" xmlns:xdg="http://www.enm.justice.fr/xdg">
 <xdg:stylesheet name="main">
  <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                                xmlns:xdg="http://www.enm.justice.fr/xdg">
   <xsl:template match="/">
    <xdg:save filename="result.xml" format="xml">
     <xsl:apply-templates/>
    </xdg:save>
   </xsl:template>
   <xsl:template match="div[@selected='true']">
    <div>
     <xsl:copy-of select="@*"/>
     <xdg:httprequest url="http://localhost/webservices/encrypt.php" method="GET" content="textstring">
      <xdg:with-param name="s" value="{.}"/>
     </xdg:httprequest>
    </div>
   </xsl:template>
   <xsl:template match="@* | node()">
    <xsl:copy>
     <xsl:apply-templates select="@* | node()"/>
    </xsl:copy>
   </xsl:template>
  </xsl:stylesheet>
 </xdg:stylesheet>
</xdg:scriptsheet>

En résultat :
<html>
 <head>
  <title>Viewport Test</title>
 </head>
 <body>
  <h1>Viewport test</h1>
  <div selected="true">AEF12DSEZEDSSQAAA</div>
  <div>Texte simple</div>
  <div selected="true">AEF12DSEZEDSSQAAA</div>
  <p>Fin</p>
 </body>
</html>

Merci pour vos remarques.

Alain COUTHURES
Ecole Nationale de la Magistrature
Bordeaux - Paris

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

--
Devenez redacteur <XML>fr et contribuez au developpement du xml francophone (http://xmlfr.org/infos/redacteurs/) !

Liste de diffusion "[email protected]" (http://xmlfr.org).

Cette liste est a votre disposition pour discuter en francais de tout sujet technique lie a XML.

Pour resilier votre abonnement, envoyez un message contenant la commande "unsubscribe" a [email protected]
(mailto:[email protected]?Subject=unsubscribe)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.