🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #9171

How to add XML Element

#9171
From: Karthik_ind
Date: Sat, 09 Sep 2006 04:08
19 lines
1224 bytes
Hi all,

I am new to javascript(early i use vbscript).

I want to tag a selection text with specific xml tag

I write the following script, but its shows the error.

Can anybody have any idea about this pl. tell me its more helpful.

--------------------------------------------------------------------
var mydoc = app.activeDocument;
var mytext = mydoc.selection;

for(i = 0; i < mydoc.xmlTags.length; i++) 	{ 	if(mydoc.xmlTags.item[i].name = "ce:italic") 		{ 		var mysel = mydoc.xmlElements(1).xmlElements.add(mydoc.xmlTags[i], mydoc.Selection); 		} 	}

--------------------------------------------------------------------

Karthik
Technical Details
Message-ID: <3bc19071.-1@webcrossing.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!news2.volia.net!news.germany.com!news.motzarella.org!news.isoc.lu!webcrossing

Show Full Headers
Complete Article Headers
X-Google-Thread: f939a,60189a0a6646dcc0,start
X-Google-Attributes: gidf939a,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: Karthik_ind@adobeforums.com
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news4.google.com!news2.volia.net!news.germany.com!news.motzarella.org!news.isoc.lu!webcrossing
Newsgroups: adobe.scripting.indesign
Subject: How to add XML Element
Message-ID: <3bc19071.-1@webcrossing.la2eafNXanI>
Date: Fri, 8 Sep 2006 21:08:27 -0700
Lines: 26
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit