You need to use the < instead of the "<". Also, if you really want the ", <, and > strings replaced in the file with string ", <, >, then you need to use & instead of the &. Here is an updated script:
<script> xmlfileopen = open(STAXResult,'r') xmlfileread = xmlfileopen.read() xmlfileopen.close() xmlfileread = xmlfileread.replace('"',"&quot;") xmlfileread = xmlfileread.replace("<","&lt;") xmlfileread = xmlfileread.replace(">","&gt;") </script> For example, if you had the following script: <script> print "\" = &quot;" print "< = &lt;" print "> = &gt;" </script> The output would show: 20091223-08:30:03 Info " = " 20091223-08:30:03 Info < = < 20091223-08:30:03 Info > = > Thanks, David David Bender STAF/STAX Development IBM Software Group, WPLC 11501 Burnet Rd. Bldg. 903-5B002 Austin, TX 78758-3400 Phone (T/L): 1-512-286-5315 (363-5315) ITN: 23635315 Email: bda...@us.ibm.com staf-stax user <stafstaxu...@gmail.com> 12/23/2009 07:47 AM To staf-users@lists.sourceforge.net cc Subject [staf-users] Can we use XML tags inside script element in stax Hi I am using below mentioned piece of python code inside script element in STAX.xml file. <script> xmlfileopen = open(STAXResult,'r') xmlfileread = xmlfileopen.read() xmlfileopen.close() xmlfileread = xmlfileread.replace('"',""") xmlfileread = xmlfileread.replace("<","<") xmlfileread = xmlfileread.replace(">",">") </script> While executing it is throwing error "The content of elements must consist of well formed character data or markup." My First question is: "Can we use XMl tags inside script element"? Second: How too overcome this issue? Regard's ------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev _______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________ staf-users mailing list staf-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/staf-users