Here is the xml file I have to customize
<?xml version="1.0"?>
<CfgExpression xsi:schemaLocation="urn:com:das:conf CfgDef.xsd" xmlns:xsi=" xmlns="urn:com:das:conf">
<Description>
<Characteristic Description="desc Equipment" Id="1" Name="Equipment">
<Characteristic Description="desc Middle equipment" Id="2" Name="Middle"/>
<Characteristic Description="desc Luxe equipment" Id="3" Name="Luxe"/>
<Characteristic Description="desc Basic equipment" Id="4" Name="Basic"/>
</Characteristic>
<Characteristic IsExclusive="true" Description="desc Engine" Id="5" Name="Engine">
<Characteristic Description="desc V6 engine" Id="6" Name="V6"/>
<Characteristic Description="desc V12 engine" Id="7" Name="V12"/>
</Characteristic>
</Description>
<Expression>
<AND>
<OR>
<EffectivityRef Id="2" Name="35827.1"/>
<EffectivityRef Id="1" Name="35828.1"/>
</OR>
<OR>
<AND>
<Characteristic Id="5" Name="Engine">
<Characteristic Id="6" Name="V6"/>
</Characteristic>
<Characteristic Id="1" Name="Equipment">
<Characteristic Id="4" Name="Basic"/>
</Characteristic>
</AND>
<AND>
<Characteristic Id="5" Name="Engine">
<Characteristic Id="7" Name="V12"/>
</Characteristic>
<Characteristic Id="1" Name="Equipment">
<Characteristic Id="3" Name="Luxe"/>
</Characteristic>
</AND>
</OR>
</AND>
</Expression>
</CfgExpression>
here is the following xsl file I use to customize it :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl=" xmlns:fo=" xmlns:xsi=" xmlns:xs=" xmlns:fn=" xmlns:cfg="urn:com:das:conf">
<xslutput method="text"/>
<!-- template CfgExpression -->
<xsl:template match="cfg:CfgExpression">
<xsl:for-each select="cfg:Expression">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:template>
<!-- template Expression -->
<!-- template Description -->
<xsl:template name="Description">
<xsl:apply-templates/>
</xsl:template>
<!-- template AND -->
<xsl:template match="cfg:AND">
<xsl:for-each select="*">
<xsl:if test="position() != 1">
<xsl:text> ; </xsl:text>
</xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- template OR -->
<xsl:template match="cfg:OR">
<xsl:for-each select="*">
<xsl:if test="position() != 1">
<xsl:text> | </xsl:text>
</xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- template Caracteristic -->
<xsl:template match="cfg:Characteristic">
<xsl:value-of select="@Name"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="cfg:Characteristic/@Name"/>
<xsl:text/>
</xsl:template>
<!-- template EffectivityRef -->
<xsl:template match="cfg:EffectivityRef">
<xsl:text>[</xsl:text>
<xsl:value-of select="@Name"/>
<xsl:text>] </xsl:text>
</xsl:template>
</xsl:stylesheet>
The result I have today :
[35827.1] | [35828.1] ; Engine,V6 ; Equipment,Basic | Engine,V12 ; Equipment,Luxe
what I would like to have :
[35827.1] | [35828.1] ; Engine,V6 ; Equipment{Basic} | Engine,V12 ; Equipment{Luxe}
the display of “{ }“ or “,” is depend of the value of ”IsExclusive” available in the <Description> part
with another xsl file I would like to have :
Engine,desc V6 Engine; Equipment{desc Basic equipment} | Engine,desc V12 Engine; Equipment{desc Luxe equipment}
in that case I would like to by pass EffectivityRef and its AND and OR associated above
please I need help for that
does someone has an idea ?
Ludovic
<?xml version="1.0"?>
<CfgExpression xsi:schemaLocation="urn:com:das:conf CfgDef.xsd" xmlns:xsi=" xmlns="urn:com:das:conf">
<Description>
<Characteristic Description="desc Equipment" Id="1" Name="Equipment">
<Characteristic Description="desc Middle equipment" Id="2" Name="Middle"/>
<Characteristic Description="desc Luxe equipment" Id="3" Name="Luxe"/>
<Characteristic Description="desc Basic equipment" Id="4" Name="Basic"/>
</Characteristic>
<Characteristic IsExclusive="true" Description="desc Engine" Id="5" Name="Engine">
<Characteristic Description="desc V6 engine" Id="6" Name="V6"/>
<Characteristic Description="desc V12 engine" Id="7" Name="V12"/>
</Characteristic>
</Description>
<Expression>
<AND>
<OR>
<EffectivityRef Id="2" Name="35827.1"/>
<EffectivityRef Id="1" Name="35828.1"/>
</OR>
<OR>
<AND>
<Characteristic Id="5" Name="Engine">
<Characteristic Id="6" Name="V6"/>
</Characteristic>
<Characteristic Id="1" Name="Equipment">
<Characteristic Id="4" Name="Basic"/>
</Characteristic>
</AND>
<AND>
<Characteristic Id="5" Name="Engine">
<Characteristic Id="7" Name="V12"/>
</Characteristic>
<Characteristic Id="1" Name="Equipment">
<Characteristic Id="3" Name="Luxe"/>
</Characteristic>
</AND>
</OR>
</AND>
</Expression>
</CfgExpression>
here is the following xsl file I use to customize it :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl=" xmlns:fo=" xmlns:xsi=" xmlns:xs=" xmlns:fn=" xmlns:cfg="urn:com:das:conf">
<xslutput method="text"/>
<!-- template CfgExpression -->
<xsl:template match="cfg:CfgExpression">
<xsl:for-each select="cfg:Expression">
<xsl:apply-templates/>
</xsl:for-each>
</xsl:template>
<!-- template Expression -->
<!-- template Description -->
<xsl:template name="Description">
<xsl:apply-templates/>
</xsl:template>
<!-- template AND -->
<xsl:template match="cfg:AND">
<xsl:for-each select="*">
<xsl:if test="position() != 1">
<xsl:text> ; </xsl:text>
</xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- template OR -->
<xsl:template match="cfg:OR">
<xsl:for-each select="*">
<xsl:if test="position() != 1">
<xsl:text> | </xsl:text>
</xsl:if>
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:template>
<!-- template Caracteristic -->
<xsl:template match="cfg:Characteristic">
<xsl:value-of select="@Name"/>
<xsl:text>,</xsl:text>
<xsl:value-of select="cfg:Characteristic/@Name"/>
<xsl:text/>
</xsl:template>
<!-- template EffectivityRef -->
<xsl:template match="cfg:EffectivityRef">
<xsl:text>[</xsl:text>
<xsl:value-of select="@Name"/>
<xsl:text>] </xsl:text>
</xsl:template>
</xsl:stylesheet>
The result I have today :
[35827.1] | [35828.1] ; Engine,V6 ; Equipment,Basic | Engine,V12 ; Equipment,Luxe
what I would like to have :
[35827.1] | [35828.1] ; Engine,V6 ; Equipment{Basic} | Engine,V12 ; Equipment{Luxe}
the display of “{ }“ or “,” is depend of the value of ”IsExclusive” available in the <Description> part
with another xsl file I would like to have :
Engine,desc V6 Engine; Equipment{desc Basic equipment} | Engine,desc V12 Engine; Equipment{desc Luxe equipment}
in that case I would like to by pass EffectivityRef and its AND and OR associated above
please I need help for that
does someone has an idea ?
Ludovic