View Single Post
 
Old June 7th, 2005, 08:11 AM
Alderian72 Alderian72 is offline
Registered User
 
Join Date: Jun 2005
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default XSLT Looks right, but no output

XML - Multiple Address response:

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.esriuk.com/gazops">
    <GAZOPS_DATA_REQUEST operation="ADDRESS_MATCH">
        <OPERATION_RESULT>success</OPERATION_RESULT>
        <PICK_LIST>
            <PICK_LIST_TYPE>Properties</PICK_LIST_TYPE>
            <FIELD_DEFINTION>
                <NAME>% Match</NAME>
                <FIELD_WIDTH>10</FIELD_WIDTH>
            </FIELD_DEFINTION>
            <FIELD_DEFINTION>
                <NAME>Value</NAME>
                <FIELD_WIDTH>500</FIELD_WIDTH>
            </FIELD_DEFINTION>
            <PICK_LIST_ENTRY id="0">
                <MATCH_COUNT>1</MATCH_COUNT>
                <CRITERIA_FIELD>GAZOPS_UNIQUE_ID</CRITERIA_FIELD>
                <IDENTITY>UPRN000000274739</IDENTITY>
                <SCORE>100</SCORE>
                <DESCRIPTION>Bcc Car Park Adjacent To, Mauretania, St Georges Road, Bristol, BS1 5UY,</DESCRIPTION>
                <FINAL>True</FINAL>
            </PICK_LIST_ENTRY>
            <PICK_LIST_ENTRY id="1">
                <MATCH_COUNT>1</MATCH_COUNT>
                <CRITERIA_FIELD>GAZOPS_UNIQUE_ID</CRITERIA_FIELD>
                <IDENTITY>UPRN000000106560</IDENTITY>
                <SCORE>100</SCORE>
                <DESCRIPTION>Brunel House, St Georges Road, Bristol, BS1 5UY,</DESCRIPTION>
                <FINAL>True</FINAL>
            </PICK_LIST_ENTRY>
            <PICK_LIST_ENTRY id="2">
                <MATCH_COUNT>1</MATCH_COUNT>
                <CRITERIA_FIELD>GAZOPS_UNIQUE_ID</CRITERIA_FIELD>
                <IDENTITY>UPRN000000274740</IDENTITY>
                <SCORE>100</SCORE>
                <DESCRIPTION>Mauretania, St Georges Road, Bristol, BS1 5UY,</DESCRIPTION>
                <FINAL>True</FINAL>
            </PICK_LIST_ENTRY>
        </PICK_LIST>
        <CACHE_ID>GZ2</CACHE_ID>
    </GAZOPS_DATA_REQUEST>
</string>

XML - Single Address Response:

<?xml version="1.0" encoding="utf-8"?>
<string xmlns="http://www.esriuk.com/gazops">
    <GAZOPS_DATA_REQUEST operation="ADDRESS_MATCH">
        <OPERATION_RESULT>success</OPERATION_RESULT>
        <CACHE_ID>GZ3</CACHE_ID>
        <ADDRESS_MATCH>
            <F>
                <N>GAZOPS_FORMATTED_ADDRESS</N>
                <V tp="xml">
                    <ADDLINE>Brunel House</ADDLINE>
                    <ADDLINE>St Georges Road</ADDLINE>
                    <ADDLINE>Bristol</ADDLINE>
                    <ADDLINE>BS1 5UY</ADDLINE>
                    <ADDLINE/>
                </V>
            </F>
            <F>
                <N>GAZOPS_UNIQUE_ID</N>
                <V>UPRN000000106560</V>
            </F>
            <F>
                <N>GAZOPS_SCORE</N>
                <V>100</V>
            </F>
            <F>
                <N>UPRN</N>
                <V>000000106560</V>
            </F>
            <F>
                <N>PAO_DESC</N>
                <V>Brunel House</V>
            </F>
            <F>
                <N>SAO_DESC</N>
                <V/>
            </F>
            <F>
                <N>STREET_NAME</N>
                <V>St Georges Road</V>
            </F>
            <F>
                <N>TOWN_NAME</N>
                <V>Bristol</V>
            </F>
            <F>
                <N>LOCALITY_NAME</N>
                <V>City Centre</V>
            </F>
            <F>
                <N>COUNTY_NAME</N>
                <V/>
            </F>
            <F>
                <N>POSTCODE</N>
                <V>BS1 5UY</V>
            </F>
            <F>
                <N>PO_BOX</N>
                <V/>
            </F>
            <F>
                <N>DEPARTMENT</N>
                <V/>
            </F>
            <F>
                <N>ORGANISATION</N>
                <V/>
            </F>
            <F>
                <N>POST_TOWN</N>
                <V/>
            </F>
            <F>
                <N>ST_KEYVAL</N>
                <V>0000C2DNSD000</V>
            </F>
            <F>
                <N>LPI_ID</N>
                <V>001BEPDNLI000</V>
            </F>
            <F>
                <N>LPI_ADDRESS</N>
                <V>Brunel House
St Georges Road
Bristol
BS1 5UY</V>
            </F>
            <F>
                <N>LPI_LOGICAL_STATUS</N>
                <V>1</V>
            </F>
            <F>
                <N>GAZOPS_EASTING</N>
                <V>358206</V>
            </F>
            <F>
                <N>GAZOPS_NORTHING</N>
                <V>172828</V>
            </F>
            <F>
                <N>GAZOPS_ALIAS_ID</N>
                <V>001BEPDNLI000</V>
            </F>
        </ADDRESS_MATCH>
    </GAZOPS_DATA_REQUEST>
</string>



XSLT:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
        <xsl:choose>
            <xsl:when test="//OPERATION_RESULT='No Match Found'">
                <xsl:choose>
                    <xsl:when test="count(//GAZOPS_VAGUE)&gt;0">
                        <response>Query is too vague. Please refine or change the query.<count>0</count>
                            <addresses/>
                        </response>
                    </xsl:when>
                    <xsl:otherwise>
                        <response>No Match Found. Please refine the query<count>0</count>
                            <addresses/>
                        </response>
                    </xsl:otherwise>
                </xsl:choose>
            </xsl:when>
            <xsl:when test="count(//ADDRESS_MATCH)=1">
                <response>Exact match found.
                    <addresses>
                        <address>
                            <xsl:for-each select="//F[N='GAZOPS_FORMATTED_ADDRESS']/V/ADDLINE">
                                <xsl:value-of select="."/>
                            </xsl:for-each>
                        </address>
                    </addresses>
                </response>
            </xsl:when>
            <xsl:otherwise>
                <response>
                    <addresses>
                        <xsl:for-each select="//PICK_LIST_ENTRY">
                            <address>
                                <xsl:value-of select="DESCRIPTION"/>
                            </address>
                        </xsl:for-each>
                    </addresses>
                </response>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:template>
</xsl:stylesheet>

OUTPUT Zilch, nada, nothing

Any ideas?