I have the XML source document:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<HELPDESK>
<board group="PATHS" >
<board id="AC659FDE" group="PATH" source="C21D8443" target="09CF5CC8"/>
<board id="1C16BEC0" group="PATH" source="C21D8443" target="01DF2C05"/>
<board id="44D44B40" group="PATH" source="C21D8443" target="44A824A6"/>
<board id="1621GUJ00" group="PATH" source="C21D8443" target="44A824A7"/>
</board>
<board group="PRIVATE_ADDRESS">
<board id="C21D8443" group="CENTRE"/>
<board id="C21D8444" group="ADDRESS1"/>
<board id="01DF2C05" group="ADDRESS2" />
<board id="09CF5CC8" group="ADDRESS3" />
</board>
<board group="PUBLIC_PLACES" >
<board id="44A824A6" group="POSTOFFICE"/>
<board id="44A824A7" group="MARKET"/>
</board>
</HELPDESK>
----
My problem is to check if the target is not Public_places and print out the link with that information.
My template starts from board[group="CENTRE"]. How to print the information which shows the private address not the public places in the list?
Could you complete the conditional expression? [And] means only print the target place which not in public_places list
Code:
<xsl:template match="board[group='CENTRE']" mode="center">
<xsl:variable name="starting" select="."/>
<xsl:for-each select="$starting">
<letgo>
<xsl:attribute name="id"> <xsl:value-of select="@id"/> </xsl:attribute>
<xsl:attribute name="startat"> <xsl:value-of select="@group"/> </xsl:attribute>
<xsl:for-each select="../../board[group='PATH]">
<xsl:if test="$starting[@id = current()/@source] and" >
<guidedirection>
<xsl:attribute name="id"> <xsl:value-of select="@id"/> </xsl:attribute>
<xsl:element name="startingpoint"> <xsl:value-of select="@source"/> </xsl:element>
<xsl:element name="destination"> <xsl:value-of select="@target"/> </xsl:element>
</guidedirection>
</xsl:if>
</xsl:for-each>
</letgo>
</xsl:for-each>
</xsl:template>