我有這樣一個XML標籤:如何更換標籤的XML
<p xmlns="http://www.w3.org/1999/xhtml">Text1<span title="instruction=componentpresentation,componentId=1234,componentTemplateId=1111">CPText2CP</span></p>
如果我有
<componentpresentation componentID="1234" templateID="1111" dcpID="dcp1111_1234" dcplocation="/wip/data/pub60/dcp/txt/dcp1111_1234.txt">Text2</componentpresentation>
更換標籤<span title="instruction=componentpresentation,componentId=1234,componentTemplateId=1111">CPText2CP</span>
任何可能的方式來找到這個,請給出建議/更改。
編輯
從上面的標籤我可以充分<span></span>
標籤與在tags.any建議之間的文本字符串。
有兩個問題。首先,是什麼元素需要被轉換爲title =「instruction = ...」屬性的標誌?另外,dcpID/dcplocation屬性來自哪裏? –
@Lunatic,是的,我需要用標記替換完整的標記,並將標記之間的文本保留爲它。 –
SDLBeginner