﻿<?xml version="1.0"?>
<xsl:transform	
		xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
		xmlns:ident="x-schema:DTMIdentSchema.xml"
		xmlns:fdt="x-schema:FDTDataTypesSchema.xml"
		xmlns:topology="x-schema:DTMTopologyScanSchema.xml"
		xmlns:fdtprofidevice="x-schema:DTMProfibusDeviceSchema.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">036D1499-387B-11D4-86E1-00E0987270B9</xsl:attribute>
					<xsl:apply-templates select="fdtprofidevice:ProfibusDevice"/>
				</xsl:element>
		<xsl:text disable-output-escaping="yes">&lt;/FDT&gt;</xsl:text>
	</xsl:template>
	
	<xsl:template match ="fdtprofidevice:ProfibusDevice">
 		
 		<xsl:element name="ScanIdentification">
 			
 		
 		<xsl:element name="IdAddress">
			<xsl:attribute name="ident:value"><xsl:value-of select="@busAddress"/></xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">BusAddress</xsl:attribute>
		</xsl:element>
 		
		<xsl:element name="IdTypeID">
			<xsl:attribute name="ident:value"><xsl:value-of select="@fdt:deviceTypeId"/></xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">DeviceTypeID</xsl:attribute>
		</xsl:element>
		
		<xsl:element name="IdBusProtocol">
			<xsl:attribute name="ident:value">Profi DVP1</xsl:attribute>
			<xsl:attribute name="ident:protocolSpecificName">BusProtocol</xsl:attribute>
		</xsl:element>
 		
 			
 		</xsl:element>
 		
 	</xsl:template>


</xsl:transform>