Nov 10, 2005 #1 kanghao IS-IT--Management Joined Jul 4, 2004 Messages 68 Location KR how can I filter out xml elements in cdata sections or comments. I have to parse xml elements and manupulate their attributes. but I want the text in the form of <TAG> ... </TAG> or <TAG/> in the cdata sections or comments untouched. help me. Thanks.
how can I filter out xml elements in cdata sections or comments. I have to parse xml elements and manupulate their attributes. but I want the text in the form of <TAG> ... </TAG> or <TAG/> in the cdata sections or comments untouched. help me. Thanks.
Nov 10, 2005 Thread starter #2 kanghao IS-IT--Management Joined Jul 4, 2004 Messages 68 Location KR I have to modify attributes values in the xml document below to a string-added value. <DOC> <Drawing id="2"><![CDATA[<EMI id="1" height="95" width="95" file="utm00004.jpg">]]> <EMI id="2" height="95" width="95" file="utm00004.jpg">ads</EMI> </Drawing> <!-- bla... <EMI id="3" height="95" width="95" file="utm00004.jpg"> ... bla --> </DOC> to <DOC> <Drawing id="2"><![CDATA[<EMI id="1" height="95" width="95" file="utm00004.jpg">]]> <EMI id="2" height="95" width="95" file="56789-utm00004.jpg">ads</EMI> </Drawing> <!-- bla... <EMI id="3" height="95" width="95" file="utm00004.jpg"> ... bla --> </DOC> the value 56789 is from a database on the id value 2. I can <EMI part using regex <EMI[\w\s\"\=\.\-\/]{0,}>. how can I filter out the tags in the comments or cdata sections? Upvote 0 Downvote
I have to modify attributes values in the xml document below to a string-added value. <DOC> <Drawing id="2"><![CDATA[<EMI id="1" height="95" width="95" file="utm00004.jpg">]]> <EMI id="2" height="95" width="95" file="utm00004.jpg">ads</EMI> </Drawing> <!-- bla... <EMI id="3" height="95" width="95" file="utm00004.jpg"> ... bla --> </DOC> to <DOC> <Drawing id="2"><![CDATA[<EMI id="1" height="95" width="95" file="utm00004.jpg">]]> <EMI id="2" height="95" width="95" file="56789-utm00004.jpg">ads</EMI> </Drawing> <!-- bla... <EMI id="3" height="95" width="95" file="utm00004.jpg"> ... bla --> </DOC> the value 56789 is from a database on the id value 2. I can <EMI part using regex <EMI[\w\s\"\=\.\-\/]{0,}>. how can I filter out the tags in the comments or cdata sections?