﻿<?xml version="1.0"?>


<xsl:transform	
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
		xmlns:ident="x-schema:DTMIdentSchema.xml"
		xmlns:fdthart="x-schema:FDTHARTCommunicationSchema.xml"
		xmlns:topology="x-schema:DTMTopologyScanSchema.xml"
		xmlns:hartscan="x-schema:DTMHARTDeviceSchema.xml" version="2.0">
		<xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/>
 
 
 	<xsl:template match="/">
 		<xsl:apply-templates select="//topology:TopologyScan"/>
 	</xsl:template>
 	
 	
 	<xsl:template match="topology:TopologyScan">
 	<xsl:text disable-output-escaping="yes">&lt;FDT xmlns="x-schema:DTMScanIdentSchema.xml" 
	 xmlns:ident="x-schema:DTMIdentSchema.xml" xmlns:fdt="x-schema:FDTDataTypesSchema.xml" &gt;</xsl:text>
				<xsl:element name="ScanIdentifications">
				<xsl:attribute name="resultState">final</xsl:attribute>
				<xsl:attribute name="fdt:busCategory">036D1498-387B-11D4-86E1-00E0987270B9</xsl:attribute>
					<xsl:apply-templates select="hartscan:HARTDevice"/>
				</xsl:element>
		<xsl:text disable-output-escaping="yes">&lt;/FDT&gt;</xsl:text>
	</xsl:template>
 	
 	<xsl:template match ="hartscan:HARTDevice">
 		
 		<xsl:element name="ScanIdentification">
 			
 		
 		<xsl:element name="IdManufacturer">
			<xsl:attribute name="ident:value"><xsl:value-of select="@fdthart:manufacturerId"/></xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">IdManufacturer</xsl:attribute>
		</xsl:element>
		
		<xsl:element name="IdTypeID">
			<xsl:attribute name="ident:value"><xsl:value-of select="@fdthart:deviceTypeId"/></xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">DeviceTypeID</xsl:attribute>
		</xsl:element>
		
		<xsl:element name="IdBusProtocol">
			<xsl:attribute name="ident:value">HART</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">BusProtocol</xsl:attribute>
		</xsl:element>
 		
 			
 		</xsl:element>
 		
 	</xsl:template>
	
</xsl:transform>
	
	