简体   繁体   English

XML / XSLT 1.0 - 如何使用XSL模板匹配一串文本?

[英]XML / XSLT 1.0 - How to use XSL Template Match for a string of text?

I have a piece of code within an XSLT 1.0 document that I am having trouble getting to work. 我在XSLT 1.0文档中有一段代码,我无法上班。

How do I correctly get XSLT 1.0 to identify/match a string? 如何正确地让XSLT 1.0识别/匹配字符串?

In the case below, Description holds the text string wich in this example is English (AAC) (2.0 ch) however it will not always be this (or the same number of characters in the string). 在下面的例子中, Description保存文本字符串,在这个例子中是English (AAC) (2.0 ch)但它并不总是这个(或字符串中相同数量的字符)。

Sometimes the string could be: English (E-AC3) (2.0 ch) for example 有时字符串可以是:例如English (E-AC3) (2.0 ch)

I have tried: 我努力了:

<xsl:template match="AudioTrack[ScannedTrack/TrackNumber > 0 and (ScannedTrack/Description = "English (AAC) (2.0 ch)")]">

but it is not working for me. 但它不适合我。

Can someone please help? 有人可以帮忙吗?

It should be 'English (AAC) (2.0 ch)' , thus: 它应该是'English (AAC) (2.0 ch)' ,因此:

<xsl:template match="AudioTrack[ScannedTrack/TrackNumber > 0 and (ScannedTrack/Description = 'English (AAC) (2.0 ch)')]">

using single quotation marks 使用单引号

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM