XSLT DXL and GovTalk address elements

Hi,

Has anyone tried to set up an xsl stylesheet to get dxl item values in to bs7666 address formats from the published govtalk schemas? I cant quite seem to identify one dxl item and then use values from other items to populate the nested bs7666 elements. eg

<xsl:template match=“dxl:item”>

	<xsl:choose>

		<xsl:when test="@name='Adress'">

			<IncidentLocation>

				<fire:Adress>

					<!--xsl:choose>

					<xsl:when test="@name='Building_Name_Number'"-->

						<bs7666:PAON>

							<bs7666:StartRange>

								<bs7666:Number>

									<xsl:value-of select="dxl:item[@name='Building_Name_Number']/dxl:text" />

								</bs7666:Number>

							</bs7666:StartRange>

						</bs7666:PAON>

					<!--/xsl:when>

						</xsl:choose-->

				</fire:Adress>

			</IncidentLocation>

		</xsl:when>

	</xsl:choose>

</xsl:template>

Subject: XSLT DXL and GovTalk address elements

Gee thanks guys for the help.

I’ve find a solution and will post extract of xslt here in case anyone else has a similar problem. Its related to XPATH and node navigation. Ive used “nested” templates and used “…/” to go up one level to get the item values

<xsl:template match="dxl:item[@name='Building_Name_Number']">

	<xsl:element name="bs7666:PAON">

		<xsl:element name="bs7666:StartRange">

			<xsl:element name="bs7666:Number">

				<xsl:value-of select="dxl:text" />

			</xsl:element>

		</xsl:element>

	</xsl:element>

</xsl:template>



<xsl:template match="dxl:item[@name='Street']">

	<xsl:element name="bs7666:StreetDescription">

		<xsl:value-of select="dxl:text" />

	</xsl:element>

	  </xsl:template>



<xsl:template match="dxl:item[@name='Locality']">

	<xsl:element name="bs7666:Locality">

		<xsl:value-of select="dxl:text" />

	</xsl:element>

	  </xsl:template>



<xsl:template match="dxl:item[@name='Town']">

	<xsl:element name="bs7666:Town">

		<xsl:value-of select="dxl:text" />

	</xsl:element>

	  </xsl:template>



<xsl:template match="dxl:item[@name='County']">

	<xsl:element name="bs7666:AdministrativeArea">

		<xsl:value-of select="dxl:text" />

	</xsl:element>

	  </xsl:template>



<xsl:template match="dxl:item[@name=&quot;PostCode&quot;]">

	<xsl:element name="bs7666:PostCode">

		<xsl:value-of select="dxl:text" />

	</xsl:element>

	  </xsl:template>



<xsl:template match="dxl:item[@name='Adress']">

	<xsl:element name="IncidentLocation">

		<xsl:element name="fire:Adress">

			<xsl:apply-templates select="../dxl:item[@name=&quot;Building_Name_Number&quot;]" />

		<xsl:apply-templates select="../dxl:item[@name=&quot;Street&quot;]" />

			<xsl:apply-templates select="../dxl:item[@name=&quot;Locality&quot;]" />

			<xsl:apply-templates select="../dxl:item[@name=&quot;Town&quot;]" />

			<xsl:apply-templates select="../dxl:item[@name=&quot;County&quot;]" />

			<xsl:apply-templates select="../dxl:item[@name=&quot;PostCode&quot;]" />

		</xsl:element>

	</xsl:element>

</xsl:template>