Bonjour voici mon fichier XML
<?xml version="1.0"?>
<ROOT>
<RELEVE>
<ENT_RLV>
<NUMRLV>1</NUMRLV>
<DTEDEB>01/09/04</DTEDEB>
</ENT_RLV>
<OPE_CMR>
<DTERMS>20/09/2004</DTERMS>
<MNTTTC>27,81</MNTTTC>
</OPE_CMR>
<OPE_CMR>
<DTERMS>20/09/2004</DTERMS>
<MNTTTC>27,81</MNTTTC>
</OPE_CMR>
<COM_CMR>
<NBROPE>6</NBROPE>
</COM_CMR>
<RCP_RLV>
<QTEVTE>6</QTEVTE>
<QTEAVO>0</QTEAVO>
</RCP_RLV>
</RELEVE>
</ROOT>
Voici le début de mon fichier XSL
<?xml version="1.0"?>
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template match="//ROOT/RELEVE">
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:str="http://xsltsl.org/string"
xmlns:html="http://www.w3.org/1999/xhtml">
<!-- ======================================================== -->
<!-- Definition des pages. . -->
<!-- ======================================================== -->
<fo:layout-master-set>
<!-- Page A-->
<fo:simple-page-master master-name="A"
page-width="210mm" page-height="297mm"
margin-top="0.1in" margin-bottom="0.5in"
margin-left="0.5in" margin-right="0.5in">
<fo:region-before extent="105mm"/>
<fo:region-body margin-top="105mm"
margin-bottom="10mm"/>
<fo:region-after extent="5mm"/>
</fo:simple-page-master>
<!-- Page B-->
<fo:simple-page-master master-name="B"
page-width="210mm" page-height="297mm"
margin-top="0.1in" margin-bottom="0.5in"
margin-left="0.5in" margin-right="0.5in">
<fo:region-before extent="105mm"/>
<fo:region-body margin-top="105mm"
margin-bottom="10mm"/>
<fo:region-after extent="5mm"/>
</fo:simple-page-master>
<!-- Page C-->
<fo:simple-page-master master-name="C"
page-width="210mm" page-height="297mm"
margin-top="0.1in" margin-bottom="0.5in"
margin-left="0.5in" margin-right="0.5in">
<fo:region-before extent="105mm"/>
<fo:region-body margin-top="105mm"
margin-bottom="10mm"/>
<fo:region-after extent="5mm"/>
</fo:simple-page-master>
<fo:page-sequence-master master-name="sequence">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference
page-position="first" master-reference="A"/>
<fo:conditional-page-master-reference
page-position="rest" master-reference="B"/>
<fo:conditional-page-master-reference
page-position="last" master-reference="C"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
</fo:layout-master-set>
<!-- ======================================================== -->
<!-- Page -->
<!-- ======================================================== -->
<fo:page-sequence master-reference="A">
<!-- entete -->
<fo:static-content flow-name="xsl-region-before">
<fo:block font-size="small" text-align="start">
<xsl:apply-templates select="ENT_RLV" />
</fo:block>
</fo:static-content>
<!-- tableau des operations -->
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="OPE_CMR" />
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="B">
<!-- entete -->
<fo:static-content flow-name="xsl-region-before">
<fo:block font-size="small" text-align="start">
<xsl:apply-templates select="ENT_RLV" />
</fo:block>
</fo:static-content>
<!-- tableau des commissions -->
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="COM_CMR" />
</fo:flow>
</fo:page-sequence>
<fo:page-sequence master-reference="C">
<!-- entete -->
<fo:static-content flow-name="xsl-region-before">
<fo:block font-size="small" text-align="start">
<xsl:apply-templates select="ENT_RLV" />
</fo:block>
</fo:static-content>
<!-- tableau des tva -->
<fo:flow flow-name="xsl-region-body">
<xsl:apply-templates select="RCP_RLV" />
</fo:flow>
</fo:page-sequence>
</fo:root>
</xsl:template>
....
Le résultat attendu est pour chaque RELEVE :
- la première du RELEVE page contenant les infos de ENT_RLV et des OPE_CMR
- la seconde page du RELEVE contenant les info de ENT_RLV et de COM_CMR
- la dernier page du RELEVE contenant les info de ENT_RLV et de RCP_RLV.
Cela fonctionne si je n'ai q'un seul RELEVE dans le doc XML.
Par contre si j'en ai plusieurs, FOP plante après le premier relevé avec un
nullpointerexception.
Comment indiquer qu'il faut une récursivité sur les RELEVE.
merci pour votre aide.
Pierre Devreux
___
Ce message est strictement confidentiel. Son intégrité n'est pas assurée
sur Internet. Le contenu de ce message ne peut engager la responsabilité du
groupe Atos Origin. Si vous n'êtes pas destinataire du message, merci d'en
avertir immédiatement l'expéditeur et de le détruire.
Bien que les meilleurs efforts soient faits pour maintenir cette
transmission exempte de tout virus, l'expéditeur ne donne aucune garantie à
cet égard et sa responsabilité ne saurait être engagée pour tout dommage
résultant d'un virus transmis.
This e-mail is privileged and may contain confidential information intended
only for the person(s) named above. If you receive this e-mail in error,
please notify the sender immediately by telephone or return e-mail.
Although the sender endeavours to maintain a computer virus free network,
the sender does not warrant that this transmission is virus-free and will
not be liable for any damages resulting from any virus transmitted.
--
Devenez redacteur <XML>fr et contribuez au developpement du
xml francophone (http://xmlfr.org/infos/redacteurs/) !
Liste de diffusion "xml-tech@xmlfr.org" (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 xml-tech-request@xmlfr.org
(mailto:xml-tech-request@xmlfr.org?Subject=unsubscribe)
Received on Thu Dec 23 10:59:47 2004