【发布时间】:2015-06-22 00:01:51
【问题描述】:
<?xml version="1.0"?>
<catalog>
<book id="Adventure">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<price>44.95</price>
<misc>
<Publisher id="5691">
<PublisherLocation>Los Angeles</PublisherLocation>
</Publisher>
<PublishedAuthor fName="Gambardella">
<StoreLocation>Store B</StoreLocation>
</PublishedAuthor>
</misc>
</book>
<book id="Adventure">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<price>5.95</price>
<misc>
<Publisher id="4787">
<PublisherLocation>New York</PublisherLocation>
</Publisher>
<PublishedAuthor Name="Ralls">
<StoreLocation>Store B</StoreLocation>
</PublishedAuthor>
</misc>
</book>
</catalog>
PublishedAuthor 的路径对于两本书都是相同的,除了一个字符。是否可以为此字符设置通配符,以便它接受任一 XPath?
<catalog/book/misc/PublishedAuthor[@fName=]/
产生与以下内容完全相同的结果:
<catalog/book/misc/PublishedAuthor[@Name=]/
【问题讨论】:
标签: vba dom xpath xml-parsing