안녕하세요 저는 그 안에 "123abc"라는 값을 가진 요소 A를 얻고 싶습니다. 나는 둘 다 시도했지만 실패했다.특정 값을 가진 그랜드 손자 노드가있는 노드를 선택하는 방법
// 패키지/A [A/B/C /. = 123ABC]
// 패키지/A [포함 (A/B/C, 123ABC)]
내가이를 반환 할 :
<A>
<System mtm="8742" os="Windows XP" oslang="en" />
<System mtm="2055" os="Windows XP" oslang="jp" />
<A>
<B>
<C>123abc</C>
<C>789</C>
<C>567</C>
</B>
</A>
</A>
샘플 XML 쿼리에 실행 :
<?xml version="1.0" encoding="UTF-8"?>
<Database version="300">
<Package>
<A>
<System mtm="8742" os="Windows XP" oslang="en" />
<System mtm="2055" os="Windows XP" oslang="jp" />
<A>
<B>
<C>123abc</C>
<C>789</C>
<C>567</C>
</B>
</A>
</A>
</Package>
<Package>
<A>
<System mtm="8742" os="Windows XP" oslang="en" />
<System mtm="2055" os="Windows XP" oslang="jp" />
<A>
<B>
<C>efg123</C>
<C>789</C>
<C>567</C>
</B>
</A>
</A>
</Package>
</Database>
당신은 여기에 답을 테스트 할 수 http://www.freeformatter.com/xpath-tester.html#ad-output
처리하려고 시도한 실제 XML이 추가되었지만 작동하지 않습니다. 특수 문자를 이스케이프 처리 할 수 있습니까? 내가 프로세스에 노력하고
실제 XML은 내가
// TableSection/SectionItem [SectionItem/세포/
을 시도, 다음과 같습니다. = 「00-18-E7-17-48-64」]// TableSection/SectionItem [포함가 (SectionItem/셀, 「00-18-E7-17-48-64」)]
<TableSection name="SNMP Devices" IsTreeFormat="true">
<SectionProperties>
<Column id="1" Name="IP Address" />
<Column id="2" Name="Description" />
</SectionProperties>
<SectionItem>
<Cell columnid="1">
192.168.99.54
</Cell>
<Cell columnid="2">
WMI XScan
</Cell>
<SectionItem>
<Cell columnid="1">
ScanType
</Cell>
<Cell columnid="2">
WMIScan
</Cell>
</SectionItem>
<SectionItem>
<Cell columnid="1">
Device description
</Cell>
<Cell columnid="2">
WMI dscription
</Cell>
</SectionItem>
<SectionItem>
<Cell columnid="1">
MACAddress
</Cell>
<Cell columnid="2">
00-18-E7-17-48-64
</Cell>
</SectionItem>
</SectionItem>
<SectionItem>
<Cell columnid="1">
192.168.99.55
</Cell>
<Cell columnid="2">
WMI XScan
</Cell>
<SectionItem>
<Cell columnid="1">
ScanType
</Cell>
<Cell columnid="2">
WMIScan
</Cell>
</SectionItem>
<SectionItem>
<Cell columnid="1">
Device description
</Cell>
<Cell columnid="2">
WMI dscription
</Cell>
</SectionItem>
<SectionItem>
<Cell columnid="1">
MACAddress
</Cell>
<Cell columnid="2">
90-2B-34-64-16-9D
</Cell>
</SectionItem>
</SectionItem>
<SectionItem>
<Cell columnid="1">
192.168.99.107
</Cell>
<Cell columnid="2">
VMWare : "navvms08.Crest.local"
</Cell>
<SectionItem>
<Cell columnid="1">
MACAddress
</Cell>
<Cell columnid="2">
00-07-E9-0D-05-C5
</Cell>
</SectionItem>
<SectionItem>
<Cell columnid="1">
Device identifier
</Cell>
<Cell columnid="2">
1.3.6.1.4.1.6876.4.1
</Cell>
</SectionItem>
<SectionItem>
<Cell columnid="1">
Device name
</Cell>
<Cell columnid="2">
"navvms08.Crest.local"
</Cell>
</SectionItem>
<SectionItem>
<Cell columnid="1">
Device description
</Cell>
<Cell columnid="2">
"VMware ESXi 5.5.0 build-1623387 VMware, Inc. x86_64"
</Cell>
</SectionItem>
</SectionItem>
</TableSection>
감사 폴. 나는 아직도 쿼리를 작동시킬 수 없기 때문에 원래의 질문을 처리하려고 시도하고있는 실제 xml을 추가했다. 많은 사람들이 나를 위해 이것을 해결할 수 있다면 고맙게 생각합니다. – Terry