4

古い ETS4 プロジェクトと新しいプロジェクトに一致するように、calimero の ets4_import を変更しようとしています。

変更することは可能ですか

<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:

ファイル全体を変更する必要がないように

4

2 に答える 2

0

XSLT 2.0 を使用すると、最初にドキュメントの名前空間を変更 (または場合によっては削除) してから、手持ちの巨大なテンプレートを適用できます。b:XYZXSLT 1.0 では、出現するすべての を に置き換えることができました*[local-name()='XYZ']

于 2013-04-12T16:15:46.190 に答える