我试图弄清楚如何只显示 | 之间的单词 和 | 在下面的 XML 描述中。例如,单词“web”或“VideoGames”。
我已经尝试过了,但是因为每个单词的长度不同,所以我不成功。另外,我无法摆脱 |
<cfoutput>#Right(thefeed2.rsschannel.eachresult.resultnumber[x].metadata.xmlAttributes.v, 10)#</cfoutput>
我也在尝试做一个相反的任务——过滤掉 | 之间的单词。和 | 所以它不显示。换句话说,以第一项为例,显示整个描述,减去单词“web”或“VideoGames”
我已经尝试过了,但同样,我遇到了与试图过滤掉描述相同的问题,没有中间的词 | 和|。
<cfoutput>#left(thefeed2.rsschannel.eachresult.resultnumber[x].metadata.xmlAttributes.v, 500)#</cfoutput>
所以我的问题是...
1:如何提取|之间的单词 和 | 从描述元素。
2:在与数字 1 不同的实例中,如何删除 | 之间的单词 和 | 在描述中?
顺便说一下,“thefeed2”就是我所说的 XML 提要。
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<rsschannel>
<resultsnumbertotal>11 </resultsnumbertotal>
<eachresult>
<resultnumber N="1">
<U>/file.cfm?id=yahoocom </U>
<T>Yahoo </T>
<metadata N="description" V="Quickly find what you're searching for, get in touch with friends and stay in-the-know |Web|"/>
</resultnumber>
<resultnumber N="2">
<U>/file.cfm?id=halo </U>
<T>Halo </T>
<metadata N="description" V="Halo is a multi-billion dollar science fiction video game franchise created by Bungie and now managed by 343 Industries and owned by Microsoft Studios. |VideoGames|"/>
</resultnumber>
<resultnumber N="3">
<U>/file.cfm?id=bingcom </U>
<T>Bing </T>
<metadata N="description" V="Bing is a search engine that brings together the best of search and people in your social networks to help you spend less time searching and more time doing. |Web|"/>
</resultnumber>
<resultnumber N="4">
<U>/file.cfm?id=lal </U>
<T>Lakers </T>
<metadata N="description" V="The Los Angeles Lakers are an American professional basketball team based in Los Angeles, California. They play in the Pacific Division |Sports|"/>
</resultnumber>
<resultnumber N="5">
<U>/file.cfm?id=quick </U>
<T>Stay in the Know </T>
<metadata N="description" V="Quickly find what you're searching for, get in touch with friends and stay in-the-know |Misc|"/>
</resultnumber>
<resultnumber N="6">
<U>/file.cfm?id=multi </U>
<T>Billion Dollars </T>
<metadata N="description" V="Halo is a multi-billion dollar science fiction video game franchise created by Bungie and now managed by 343 Industries and owned by Microsoft Studios. |Misc|" />
</resultnumber>
<resultnumber N="7">
<U>/file.cfm?id=searching </U>
<T>Searches </T>
<metadata N="description" V="Bing is a search engine that brings together the best of search and people in your social networks to help you spend less time searching and more time doing. |Web|" />
</resultnumber>
<resultnumber N="8">
<U>/file.cfm?id=LosAngeles </U>
<T>Los Angeles </T>
<metadata N="description" V="The Los Angeles Lakers are an American professional basketball team based in Los Angeles, California. They play in the Pacific Division |Sports|"/>
</resultnumber>
<resultnumber N="9">
<U>/file.cfm?id=quick </U>
<T>Stay in the Know </T>
<metadata N="description" V="Quickly find what you're searching for, get in touch with friends and stay in-the-know |Misc|"/>
</resultnumber>
<resultnumber N="10">
<U>/file.cfm?id=LosAngeles </U>
<T>Los Angeles </T>
<metadata N="description" V="The Los Angeles Lakers are an American professional basketball team based in Los Angeles, California. They play in the Pacific Division"/>
</resultnumber>
<resultnumber N="11">
<U>/file.cfm?id=quick </U>
<T>Stay in the Know </T>
<metadata N="description" V="Quickly find what you're searching for, get in touch with friends and stay in-the-know |SummaryofDescription|"/>
</resultnumber>
</eachresult>
</rsschannel>