XML Notepad++ 中的工具:指望 xPath 不可用?
XML Tools in Notepad++: Count on xPath unavailable?
我正在尝试使用 XML 工具评估 Notepad++ 中 xPath 表达式的计数。不幸的是,我收到插件 "Error: error on XPath expression".
的错误消息
截图:
样本data/file:
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
</catalog>
目标是,统计书籍的数量。知道为什么我的表情不起作用吗?不支持 count() 吗?感谢您的任何见解!
注意:我知道对于这种简单的情况,可以只使用 search/count 函数。但我的意图是,在更复杂的 xPath 表达式上使用 count() 函数。
我正在使用最新版本的 Notepad++ v.7.8.5 64 位,以及最新版本的 XML Tools 插件 3.0.3.4。我遇到了和你一样的错误。
这似乎是插件中的错误。
这里也一样。该插件构建为 return 个节点而不是字符串。
支持计数功能(//book[count(./*)>2]
但您不能将其用于 return 一个值。
可能的解决方法:在激活正则表达式选项的情况下使用搜索面板中的计数功能。
例如:
(?<=Midnight Rain</title>\r\n.{8}).\<genre>
将计算特定标题后 "genre" 个元素的数量。
好像还是坏了。我最终使用了带有 XML Tools 扩展名的 VS Code……效果很好。谢谢你的 testing/feedback.
我正在尝试使用 XML 工具评估 Notepad++ 中 xPath 表达式的计数。不幸的是,我收到插件 "Error: error on XPath expression".
的错误消息截图:
样本data/file:
<?xml version="1.0"?>
<catalog>
<book id="bk101">
<author>Gambardella, Matthew</author>
<title>XML Developer's Guide</title>
<genre>Computer</genre>
<price>44.95</price>
<publish_date>2000-10-01</publish_date>
<description>An in-depth look at creating applications
with XML.</description>
</book>
<book id="bk102">
<author>Ralls, Kim</author>
<title>Midnight Rain</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-12-16</publish_date>
<description>A former architect battles corporate zombies,
an evil sorceress, and her own childhood to become queen
of the world.</description>
</book>
<book id="bk103">
<author>Corets, Eva</author>
<title>Maeve Ascendant</title>
<genre>Fantasy</genre>
<price>5.95</price>
<publish_date>2000-11-17</publish_date>
<description>After the collapse of a nanotechnology
society in England, the young survivors lay the
foundation for a new society.</description>
</book>
</catalog>
目标是,统计书籍的数量。知道为什么我的表情不起作用吗?不支持 count() 吗?感谢您的任何见解!
注意:我知道对于这种简单的情况,可以只使用 search/count 函数。但我的意图是,在更复杂的 xPath 表达式上使用 count() 函数。
我正在使用最新版本的 Notepad++ v.7.8.5 64 位,以及最新版本的 XML Tools 插件 3.0.3.4。我遇到了和你一样的错误。
这似乎是插件中的错误。
这里也一样。该插件构建为 return 个节点而不是字符串。
支持计数功能(//book[count(./*)>2]
但您不能将其用于 return 一个值。
可能的解决方法:在激活正则表达式选项的情况下使用搜索面板中的计数功能。
例如:
(?<=Midnight Rain</title>\r\n.{8}).\<genre>
将计算特定标题后 "genre" 个元素的数量。
好像还是坏了。我最终使用了带有 XML Tools 扩展名的 VS Code……效果很好。谢谢你的 testing/feedback.