我是 xml 编辑的新手,我需要复制描述 TIA Portal 中变量的 xml 文件片段,并将其粘贴到同一文件的下方,这样我就可以得到另一个相同的 var,以后可以编辑。是否有严格的“复制”功能来复制包含所有子节点和值的整个结构片段?更像是文本复制粘贴?
这是我要 1:1 复制的 xml 片段:
<Hmi.Tag.Tag ID="40C" CompositionName="Tags">
<AttributeList>
<AcquisitionTriggerMode>Visible</AcquisitionTriggerMode>
<AddressAccessMode>Symbolic</AddressAccessMode>
<Coding>Binary</Coding>
<ConfirmationType>None</ConfirmationType>
<GmpRelevant>false</GmpRelevant>
<JobNumber>0</JobNumber>
<Length>2</Length>
<LinearScaling>false</LinearScaling>
<LogicalAddress />
<MandatoryCommenting>false</MandatoryCommenting>
<Name>Index_ManualControl[9]</Name>
<Persistency>false</Persistency>
<QualityCode>false</QualityCode>
<ScalingHmiHigh>100</ScalingHmiHigh>
<ScalingHmiLow>0</ScalingHmiLow>
<ScalingPlcHigh>10</ScalingPlcHigh>
<ScalingPlcLow>0</ScalingPlcLow>
<StartValue />
<SubstituteValue />
<SubstituteValueUsage>None</SubstituteValueUsage>
<Synchronization>false</Synchronization>
<UpdateMode>ProjectWide</UpdateMode>
<UseMultiplexing>false</UseMultiplexing>
</AttributeList>
<LinkList>
<AcquisitionCycle TargetID="@OpenLink">
<Name>1 s</Name>
</AcquisitionCycle>
<Connection TargetID="@OpenLink">
<Name>OP170_HMI_Connection</Name>
</Connection>
<ControllerTag TargetID="@OpenLink">
<Name>DB11000_OPXXX_StationData.ManualControl.Navigation.HMI_Index[9]</Name>
</ControllerTag>
<DataType TargetID="@OpenLink">
<Name>Int</Name>
</DataType>
<HmiDataType TargetID="@OpenLink">
<Name>Int</Name>
</HmiDataType>
</LinkList>
<ObjectList>
<MultilingualText ID="40E" CompositionName="Comment">
<ObjectList>
<MultilingualTextItem ID="40F" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
<MultilingualText ID="410" CompositionName="DisplayName">
<ObjectList>
<MultilingualTextItem ID="411" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
<MultilingualText ID="412" CompositionName="TagValue">
<ObjectList>
<MultilingualTextItem ID="413" CompositionName="Items">
<AttributeList>
<Culture>en-US</Culture>
<Text />
</AttributeList>
</MultilingualTextItem>
</ObjectList>
</MultilingualText>
</ObjectList>
</Hmi.Tag.Tag>
父节点是:
<Hmi.Tag.TagTable ID="0">
<AttributeList>
<Name>ManualControl</Name>
</AttributeList>
<ObjectList>
(...)
</ObjectList>
我需要复制整个大结构并将其放在下面,所以在 (...) 里面。然后,我将使用“for”语句根据另一个文件中的数组大小生成变量。