XPath - 解析内部属性值

XPath - Parsing inside Attribute Values

这个问题对大多数人来说可能很容易回答,因为我是一个完全的初学者。

我在 XML 中有一个属性值,其中包含由分隔符分隔的几条信息。 现在我只想从属性中读取一个特定的信息。

这是一个例子:

<Product DueDate="" FinishedTrimHeight="" FinishedTrimWidth="" ID="" Name="" Notes="1000 | ST | 170ma | 4/4 | 135ma | 4/4 | F-EB-4S DBK-16S | BNDLI | SaddleStitch | Links | Sped" RequiredQuantity="" TextContentFile="" Type=""> </Product>

在这种情况下,我只想从属性中提取“170ma”。

提前致谢!

试试这样的东西:

tokenize(Product/@Notes, ' \| ')[3]

我说“类似”是因为您没有 post 您的尝试,并且不清楚您需要从哪个上下文中得到它。

需要 XSLT 2.0 或更高版本。