我正在尝试从 calimero 修改 ets4_import 以匹配旧 ETS4 项目和新项目。
是否可以修改
<xsl:template match="/" xmlns:b="http://knx.org/xml/project/11">
类似于
<xsl:template match="/" xmlns:b="http://knx.org/xml/project/11 or http://knx.org/xml/project/10">
XML 文件要么以
<?xml version="1.0" encoding="utf-8"?>
<KNX xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" CreatedBy="ETS4" ToolVersion="ETS 4.0.3 (Build 3250)" xmlns="http://knx.org/xml/project/11">
或者
<?xml version="1.0"?>
<KNX xmlns="http://knx.org/xml/project/10" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" CreatedBy="ETS4" ToolVersion="4.0.1387.12605">
这是完整的 XSL 文件。
有谁能够帮我?
谢谢
更新
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:b10="http://knx.org/xml/project/10" xmlns:b="http://knx.org/xml/project/11" >
<xsl:output method="xml" version="1.0" encoding="iso-8859-1" indent="yes"/>
<xsl:template match="/">
<xsl:for-each select="b:KNX/b:Project/b:Installations/b:Installation/b:Topology">
<datapoints>
<xsl:for-each select="b:Area/b:Line/b:DeviceInstance/b:ComObjectInstanceRefs/b:ComObjectInstanceRef">
<xsl:sort select="b:Connectors/b:Send/@GroupAddressRefId"/>
<xsl:if test="not(preceding::b:Connectors/b:Send/@GroupAddressRefId = current()/b:Connectors/b:Send/@GroupAddressRefId)">
<xsl:for-each select="b:Connectors">
<xsl:variable name="verz" select="document(concat(substring(../@RefId,0,7),'/',substring-before(../@RefId, '_O'), '.xml'))/b:KNX/b:ManufacturerData/b:Manufacturer/b:ApplicationPrograms/b:ApplicationProgram/b:Static/b:ComObjectTable/b:ComObject[@Id = ../../b:ComObjectRefs/b:ComObjectRef[@Id = current()/../@RefId]/@RefId]" />
<xsl:variable name="grosse">
有没有可能定义
b: = b: | b10:
这样我就不必更改完整的文件