0
私はXPathの持っている:xpath(1xml)バグですか?
//*[namespace-uri() = 'http://foundation.org/UA/2011/03/NodeSet.xsd'][local-name() = 'Reference'][@ReferenceType = 'HasNotifier']/../../Description[@Locale="en"]
をしかし、このxmlファイルでは動作しません。たぶん私の間違いか、おそらくlxmlのバグです...私は分かりません。私は正しいと正しいxpathコードを作成する数日を試しています。しかし、私はこれを正しく行うことはできません:(それは1xmlのバグか間違いですか?
"HasNotifier"が "002CC-ESSO01。(WAAA05.01?1)"と印刷したいのですが
私のXMLファイルのサンプル:
<?xml version="1.0" encoding="UTF-8" ?>
<!-- created at 2017-03-09 08:23:40 -->
<UANodeSet xmlns="http://foundation.org/UA/2011/03/NodeSet.xsd" xmlns:uax="http://foundation.org/UA/2008/02/Types.xsd">
<NamespaceUris>
<Uri>http://www.vise.com/Server/UA/</Uri>
</NamespaceUris>
<Aliases>
<!-- data types -->
<Alias Alias="Boolean">i=1</Alias>
<Alias Alias="SByte">i=2</Alias>
<Alias Alias="Byte">i=3</Alias>
<Alias Alias="Int16">i=4</Alias>
<Alias Alias="UInt16">i=5</Alias>
<Alias Alias="Int32">i=6</Alias>
<Alias Alias="UInt32">i=7</Alias>
<Alias Alias="Int64">i=8</Alias>
<Alias Alias="UInt64">i=9</Alias>
<Alias Alias="Float">i=10</Alias>
<Alias Alias="Double">i=11</Alias>
<Alias Alias="String">i=12</Alias>
<Alias Alias="DateTime">i=13</Alias>
<Alias Alias="ByteString">i=15</Alias>
<Alias Alias="XmlElement">i=16</Alias>
<Alias Alias="NodeId">i=17</Alias>
<Alias Alias="LocalizedText">i=21</Alias>
<!-- references -->
<Alias Alias="Organizes">i=35</Alias>
<Alias Alias="HasEventSource">i=36</Alias>
<Alias Alias="HasModellingRule">i=37</Alias>
<Alias Alias="HasTypeDefinition">i=40</Alias>
<Alias Alias="HasSubtype">i=45</Alias>
<Alias Alias="HasProperty">i=46</Alias>
<Alias Alias="HasComponent">i=47</Alias>
<Alias Alias="HasNotifier">i=48</Alias>
<!-- types -->
<Alias Alias="BaseDataType">i=24</Alias>
<Alias Alias="BaseObjectType">i=58</Alias>
<Alias Alias="FolderType">i=61</Alias>
<Alias Alias="BaseVariableType">i=62</Alias>
<Alias Alias="PropertyType">i=68</Alias>
<!-- modelling rules -->
<Alias Alias="New">i=78</Alias>
<Alias Alias="Shared">i=79</Alias>
</Aliases>
<UAObject NodeId="ns=1;s=AGENT" BrowseName="1:AGENT">
<DisplayName Locale="en">AGENT</DisplayName>
<Description Locale="en">AGENT</Description>
<References>
<Reference ReferenceType="HasComponent" IsForward="false">i=85</Reference>
<Reference ReferenceType="HasTypeDefinition">ns=1;s=ObjectTypes.VISE.Server.Local</Reference>
</References>
<Extensions>
<VISE ExportedNodeId="ns=1;s=AGENT.OBJECTS.WAAA05.01.002CC-ESSO01" ExportedBrowseName="1:002CC-ESSO01" Upstream="true"/>
</Extensions>
</UAObject>
<UAObject NodeId="ns=1;s=AGENT.OBJECTS" BrowseName="1:OBJECTS">
<DisplayName Locale="en">OBJECTS</DisplayName>
<Description Locale="en">OBJECTS</Description>
<References>
<Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=AGENT</Reference>
<Reference ReferenceType="HasTypeDefinition">FolderType</Reference>
</References>
<Extensions>
<VISE Upstream="true"/>
</Extensions>
</UAObject>
<UAObject NodeId="ns=1;s=AGENT.OBJECTS.WAAA05" BrowseName="1:WAAA05">
<DisplayName Locale="en">WAAA05</DisplayName>
<Description Locale="en">WAAA05</Description>
<References>
<Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=AGENT.OBJECTS</Reference>
<Reference ReferenceType="HasTypeDefinition">FolderType</Reference>
</References>
<Extensions>
<VISE Upstream="true"/>
</Extensions>
</UAObject>
<UAObject NodeId="ns=1;s=AGENT.OBJECTS.WAAA05.01" BrowseName="1:01">
<DisplayName Locale="en">01</DisplayName>
<Description Locale="en">01</Description>
<References>
<Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=AGENT.OBJECTS.WAAA05</Reference>
<Reference ReferenceType="HasTypeDefinition">FolderType</Reference>
</References>
<Extensions>
<VISE Upstream="true"/>
</Extensions>
</UAObject>
<UAObject NodeId="ns=1;s=AGENT.OBJECTS.WAAA05.01.002CC-ESSO01" BrowseName="1:002CC-ESSO01">
<DisplayName Locale="en">002CC-ESSO01</DisplayName>
<Description Locale="en">002CC-ESSO01</Description>
<References>
<Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=AGENT.OBJECTS.WAAA05.01</Reference>
<Reference ReferenceType="HasTypeDefinition">ns=1;s=ObjectTypes.PROJECT.Foren.Notek_Table</Reference>
<Reference ReferenceType="HasComponent">ns=1;s=ObjectTypes.PROJECT.Foren.Notek_Table.Overview</Reference>
<Reference ReferenceType="HasComponent">ns=1;s=ObjectTypes.PROJECT.Foren.Notek_Table.Version</Reference>
</References>
</UAObject>
<UAVariable NodeId="ns=1;s=AGENT.OBJECTS.WAAA05.01.002CC-ESSO01.Pressed" BrowseName="1:Pressed" DataType="Boolean" AccessLevel="7" UserAccessLevel="7" Historizing="true">
<DisplayName Locale="en">Pressed</DisplayName>
<Description Locale="en">002CC-ESSO01.(WAAA05.01?1)</Description>
<References>
<Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=AGENT.OBJECTS.WAAA05.01.002CC-ESSO01</Reference>
<Reference ReferenceType="HasTypeDefinition">BaseVariableType</Reference>
<Reference ReferenceType="HasNotifier">ns=1;s=ObjectTypes.PROJECT.Foren.Notek_Table.Pressed.ButtonPressed</Reference>
</References>
<Value>
<uax:Boolean>false</uax:Boolean>
</Value>
</UAVariable>
<UAVariable NodeId="ns=1;s=AGENT.OBJECTS.WAAA05.01.002CC-ESSO01.Pressed.MirrorInput" BrowseName="1:MirrorInput" DataType="String" AccessLevel="7" UserAccessLevel="7" Historizing="true">
<DisplayName Locale="en">MirrorInput</DisplayName>
<Description Locale="en">MirrorInput</Description>
<References>
<Reference ReferenceType="HasComponent" IsForward="false">ns=1;s=AGENT.OBJECTS.WAAA05.01.002CC-ESSO01.Pressed</Reference>
<Reference ReferenceType="HasTypeDefinition">ns=1;s=VariableTypes.VISE.Mirror.Input</Reference>
</References>
<Value>
<uax:String>Serwise/ns=4;s=Signals.WAAA05_01_002CC_ESSO01</uax:String>
</Value>
</UAVariable>
</UANodeSet>