Article View: adobe.scripting.indesign
Article #16361Re: [vb.net] importing XML file into InDesign
From: Richard R�nnb�ck
Date: Thu, 18 Sep 2003 05:03
Date: Thu, 18 Sep 2003 05:03
44 lines
2857 bytes
2857 bytes
Nicolas, I'm glad to see that it helped. I am learning VB and have a rudimentary understanding of it, but at the time of writing I did not have access to my Windows machine. The objects and methods are however almost identical for scripting applications such as InDesign, it�s only the syntax that is different. The key to understanding how to work with XML in InDesign is to understand how to connect page objects and the XML content you just imported. To make it really simple, you can just view the structure pane for your document (before and after xml import) and drag the xml content to any empty space on the document. As you do, a text frame will be created with your xml contents and your content is now connected to a text frame. Once the xml content is connected to a page object any changes to the content in the text frame will be reflected in the xml content as well (to try, change the text frame contents, export an xml file and notice that it reflects these changes) Likewise, once they are connected, importing (and replacing) the xml content will be reflected in the text frame. (to try, change the text frame contents to whatever you like, and then reimport the xml file, notice how the content is restored) Adobe has put some tutorials and sample files on the web and I think it is a good idea to walk through them so you have a genuine understanding of how it works in the UI, that will help you better understand what your script should accomplish. The files are located at: http://www.adobe.com/products/indesign/crossmedia.html If the xml sample you included is representative of what you will be dealing, you are very fortunate, as it is a very easy structure, which will make your scripts much easier to create. Good luck! / Richard PS. Please keep us posted through the forum on what is happening, your progress and sample code will help others (and me too, in improving my VB skills)
Technical Details
Message-ID:
<BB8F095B.183A0%richard.ronnback@telia.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!newscore.univie.ac.at!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<2ccd750f.-1@webx.la2eafNXanI> <2ccd750f.2@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,8e86ee293c0d0240 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-09-17 22:08:05 PST From: Richard R�nnb�ck <richard.ronnback@telia.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!skynet.be!skynet.be!newscore.univie.ac.at!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.scripting.indesign Subject: Re: [vb.net] importing XML file into InDesign Message-ID: <BB8F095B.183A0%richard.ronnback@telia.com> Date: Wed, 17 Sep 2003 22:03:55 -0700 References: <2ccd750f.-1@webx.la2eafNXanI> <2ccd750f.2@webx.la2eafNXanI> Lines: 60 User-Agent: Microsoft-Entourage/10.1.4.030702.0 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit