嗨,大家好
我想创建一个 xslt 2.0 样式表来执行以下操作:
拆分下面的 xml 元素值:
<sample>Please Move the asset as below
Asset Name: My Monitor 40 inch_123456789123
Asset Serial Number: 123456789123
Current Details:
Costcenter: 1234-123456 MY COST CENTRE
Location: 12 - 1234 - 1234 - MY COST ADDRESS,12 MY STR.,10TH FLOOR,,CITY,Country Name
Destination Details:
Cost Center: 1234-12345 : 5678-91234 Some Place</sample>
在每 70 个字符上,然后将前 9 个结果分别分配给一个固定的、配置的新元素名称,并丢弃任何剩余的匹配项。例子:
<humpty>first 70chars</humpty>
<dumpty>second70chars</dumpty>
<sat>third70chars</sat>
etc...
我考虑过使用 tokenize 但被卡住了,因为它需要一个字符串模式来匹配。我考虑过使用子字符串,但我不确定格式。
任何建议表示赞赏!