add bold text to XML paragraph element


i'm trying following output:

<book><p>hello <bold>brown</bold> cow</p></book>

 

this have:

var tagroot = new xml("<book>");

tagroot[0].p[0] = "hello now";

tagroot[0].p[0].bold = "brown";

tagroot[0].p[0] += " cow";

alert(tagroot)

 

for reason turns brackets bold tag html entities.

 

how above output?

 

thanks,

 

kurtis

 var tagroot = new xml("<book>"); tagroot[0].p[0] = "hello now"; tagroot[0].p[0].bold = "brown"; tagroot[0].p[0].appendchild (" cow"); alert(tagroot.toxmlstring()) 

 

 

tagroot[0].p[0] += " cow" first convert contents of <p> tag string, append the  word "cow" assign new string content <p> tag.



More discussions in InDesign Scripting


adobe

Comments

Popular posts from this blog

after effects warning: unable to create drawing surface

Maximum number of authorizations reached!