1
我想創建一個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...
我考慮過使用標記大小但被卡住了,因爲它需要一個字符串模式來匹配。我想過使用子字符串,但我不確定格式。
任何意見是讚賞!
你可以用'分析,string'。不過,我不知道在哪裏,你想從 –
感謝馬丁得到像'humpty'新的元素名稱。新的元素名稱將在樣式表中預先配置並始終保持不變。爲了舉例,我使用了「矮胖」等。 – Scrat