XSLT transformation depending on parent items value

Viewed 60

I'm trying to get following to work.

XML:

<Results xmlns="http://schemas.microsoft.com/sharepoint/soap/">
<Result ID="4,New">
    <ErrorCode>0x00000000</ErrorCode>
    <ID />
    <z:row ows_ContentTypeId="0x0100142A0297E606694EA802A784F2232A63" ows_Title="APT.2342362" ows_LinkTitleNoMenu="APT.2342362" ows_LinkTitle="APT.2342362" ows_LinkTitle2="APT.2342362" ows_FacilityNumber="2342362" ows_Status="New" ows_TenantArea="17;#Africa &amp; Asia Pacific" xmlns:z="#RowsetSchema" />
</Result>
<Result ID="5,New">
    <ErrorCode>0x00000000</ErrorCode>
    <ID />
    <z:row ows_ContentTypeId="0x0100142A0297E606694EA802A784F2232A63" ows_Title="APT.2342342" ows_LinkTitleNoMenu="APT.2342342" ows_LinkTitle="APT.2342342" ows_LinkTitle2="APT.2342342" ows_FacilityNumber="2342342" ows_Status="New" ows_TenantArea="17;#Africa &amp; Asia Pacific" xmlns:z="#RowsetSchema" />
</Result>

my XSL looks like this:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output indent="yes" method="xml"/>
    <xsl:template match="/" name="ShowVariables">
        <xsl:for-each select="//*[name()='z:row']">
            <xsl:value-of select="@ows_Title"/>
        </xsl:for-each>
    </xsl:template>
</xsl:stylesheet>

I need to check for the "ErrorCode" if the value is "0x00000000" or not and process the rows separately on that condition.

2 Answers
Related