comment ajouter une condition ?
bonjour,
je veux réaliser un XSLT pour passer d'un xml à un autre mais j'ai un problème de syntaxe
mon fichier xml initial :
Code:
1 2 3 4 5 6 7 8 9
| <process id="process" isExecutable="true">
<startEvent id="sid-BEF2442F-5A88-4A2C-8CE7-758BD0DF22D0"/>
<userTask id="sid-615ABB5C-437B-490F-9D80-A7105D034CD3"/>
<sequenceFlow id="sid-06902D8E-B3FD-45C7-BFEC-08306D7CB087" sourceRef="sid-BEF2442F-5A88-4A2C-8CE7-758BD0DF22D0" targetRef="sid-615ABB5C-437B-490F-9D80-A7105D034CD3"/>
<userTask id="sid-57B833D8-D076-46D3-B1B9-58BF917B5186"/>
<sequenceFlow id="sid-FC61B8CB-B40C-4B37-BF0E-0811B72DF0CB" sourceRef="sid-615ABB5C-437B-490F-9D80-A7105D034CD3" targetRef="sid-57B833D8-D076-46D3-B1B9-58BF917B5186"/>
<endEvent id="sid-70E2DB5F-5799-4A57-8D06-9EFD3CD5EC4E"/>
<sequenceFlow id="sid-D18F8537-03B2-4CA1-8F53-13E80EF0C699" sourceRef="sid-57B833D8-D076-46D3-B1B9-58BF917B5186" targetRef="sid-70E2DB5F-5799-4A57-8D06-9EFD3CD5EC4E"/>
</process> |
quant à mon xslt :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| <?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:drools="http://www.jboss.org/drools"
xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns="urn:jbpm.org:jpdl-3.2">
<xsl:template match="bpmn:startevent">
<start-state>
<xsl:attribute name="name">
<xsl:value-of select="@name"/>
</xsl:attribute>
</start-state>
</xsl:template>
<!-- -------------------------------------------------------------
ici
-------------------------------------------------------------- -->
<xsl:if test="startEvent/@id=sequenceFlow/@sourceRef">
<xsl:template match="bpmn:sequenceFlow">
<transition>
<xsl:attribute name = "name">
<xsl:value-of select="@name"/>
</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="translate(@name,' ','_')"/>
</xsl:attribute>
<xsl:attribute name="to">
<xsl:value-of select="@targetRef"/>
</xsl:attribute>
</transition>
</xsl:template>
</xsl:if>
</xsl:stylesheet> |
mais ce code ne marche pas mlheureusement, il ya une erreur au niveau de la condition if:(
Ce que je veux exprimer : je dois tester si l'id du startEvent est égale à sourceRef de sequenceFlow si oui dans ce cas je vais afficher la transition dans mon nouveau xml