Import of XML with xslt in InDesign CS4

Hi all

I need help from someone who is an expert of the features of xml and xslt to InDesign CS4.

I work in the publication, in addition to our magazine, we produce directories with lots of fields of information repetative in them. We get xml marker data flowing us in to InDesign. the xml files are simple, here's an example:

<? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >

< root >

< Story >

Afghanistan < country > < / country >

< Company_ID >

Kam Air < Company_Name > < / Company_Name >

< Company_Code > 1 < / Company_Code >

< Address_text > 1205 Qalla Fatuha < / Address_text >

P.O.Box < Address_text > 456 < / Address_text >

< Address_text > Kabul < / Address_text >

< Address_text > 22004 < / Address_text >

Afghanistan < Address_text > < / Address_text >

< Telephone_text > phone: + 93 20 2200 108 < / Telephone_text >

< Fax_text > Fax: + 93 20 2200 110 < / Fax_text >

< Email_text > E-mail: [email protected] < / Email_text >

< Website_text > Web site: www.flykamair.com < / Website_text >

< Personel_text > Abdul Raquib, Chief Executive < Personel_text >

< Personelmail_text > ([email protected]) < / Personelmail_text >

A1 < Job_code > < / Job_code >

< / Company_ID >

The < country > Albania < / country >

etc.

< / history >

< / root >

the problem is that we are not < Company_Code > and < Job_code > items displayed in the InDesign file.

So we created an xslt file that should get rid of these two unwanted items (obviously the above xml file has been reported in this xslt file)

<? XML version = "1.0"? >

" < xsl: stylesheet xmlns: xsl = ' http://www.w3.org/1999/XSL/transform "version ="1.0"> "

< xsl: template match = "/" >

< root >

< Story >

< country >

< xsl: for-each select = "Company_ID" >

< Company_ID >

< xsl: value-of select = "Company" / >

< xsl: value-of select = "Address" / >

< xsl: value-of select = "Telephone_text" / >

< xsl: values-Select = "Fax_tex" / >

< xsl: value-of select = Email_text "/ >"

< xsl: value-of select = "Website_text" / >

< xsl: value-of select = "Personel_text" / >

< xsl: value-of select = "Pesronelmail_text" / >

< / Company_ID >

< / xsl: foreach >

< / history >

< / root >

< / xsl: template >

< / xsl: stylesheet >

but it does not work. could someone tell me what is the problem with the XSLT? or what would be the correct XSLT?

Thank you all!

This is the kind of thing I want to tell more in detail.

First of all, the XML file:

Afganistan

Kam Air

1

1205 Qalla Fatuha

P.O.Box 456

Kabul

22004

Afganistan

Phone: + 93 20 2200 108

Fax: + 93 20 2200 110

E-mail: [email protected]

Web site: www.flykamair.com

Abdul Raquib, Chief Executive Officer

([email protected])

A1

Another company

2

Elsewhere

P.o. Box 123

Another city

22005

Afganistan

Phone: + 12345678

Fax: + 12345678

E-mail: [email protected]

Web site: www.dfhdfh.com

dfhdfhdfhdfhdfh

dfhdfhdfhdfh

A2

Albania

Number 3

3

Somewhere in Albania

Freedonia Avenue

Regardless of the capital of the Albania is called

88888

Albania

Phone: + 666 666 666 666

Fax: + 777 777 777 777

E-mail: [email protected]

Web site: www.albaniar.com

Ludwig Wittgenstein, Chief Executive Officer

([email protected])

A1

Note that I renamed the file XSL 'transform2.xsl '. I've got rid of the label of 'Story', and I nested tags more appropriately, with a new label "Country_name". Here is the XSL:

http://www.w3.org/1999/XSL/transform"version ="1.0">

(This file must be saved as "transform2.xsl" to match the link on line 2 of the XML.)

Hope that works - Jeremy

Tags: InDesign

Similar Questions

  • Import of PageMaker 7.0 to InDesign CS4 Styles

    I'm trying to switch to use PageMaker 7.0 for InDesign CS4 and so far everything is going pretty well, but I was curious to know if there is anyway that I can import all my PageMaker paragraph styles in InDesign. It would be great if I can, because I really don't want to have to recreate them.


    Any help at all would be appreciated. Thank you!

    Mike!

    Take a PM file that contains them all, then open it in InDesign.

    Save as INDD and then use it to load the styles you want.

    But... I will warn you that ID much better master typography so I would certainly dive and refine these styles. And don't forget dialing, nested styles, grep styles and styles of line and live ammunition.

    Bob

  • Export XML with XSLT

    Dear Scripting Guys,

    With this little script, you can export XML.

    But is there a way that you can use an XSLT transformation to export the XML file?

    var w = new Window ("dialog");  
    var myBut = w.add ("button", undefined, "EXPORT", {name: "ok"});  
    var myName = app.activeDocument.name.split(".indd").join(".xml");  
    if (w.show() == 1){  
        try {  
             var myFolder = Folder.selectDialog("Select the folder", "");   
             app.scriptPreferences.userInteractionLevel=UserInteractionLevels.neverInteract;  
             var myInxfile = new File(myFolder.fsName+"/"+app.activeDocument.name.split(".indd")[0]+".xml");  
             app.activeDocument.exportFile(ExportFormat.XML, myInxfile);  
             } catch(err) {alert(err);}  
         }  
    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL; 
    

    XSLT:

    <?xml version='1.0' encoding='UTF-8' ?>
    <xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform'>
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>  
    
    
    <!-- Match everything -->  
    <xsl:template match="@*|node()">  
    <xsl:copy>  
    <xsl:apply-templates select="@*|node()" />  
    </xsl:copy>  
    <xsl:text>  
    </xsl:text></xsl:template>  
      
    </xsl:stylesheet>  
    

    Greetings

    Insert before line 9:

    app.activeDocument.xmlExportPreferences.allowTransform = true;

    app.activeDocument.xmlExportPreferences.transformFilename = File ('PATH_TO_YOUR_TRANSFROM_FILE');

  • Problems with tables in InDesign CS4

    Recently upgraded to CS4, I had problems with editing features in tables. The problem occurs after working on a table for awhile - where in a first time, I am able to change the color of the outline and weight very well, but then, after a period of time, it becomes buggy and I'm more able to bring additional features line/column, as changes not being not able to set the color of the outline to zero. The part-time work around, I've found is to leave InDesign and re-launch, and then reopen the document, how can I then change the traits of the table - but only for a while until the problem again and I have to repeat the process of exit and restart. I was wondering if anyone else has had a similar problem and could know a fix (or better work around), or if this is a known bug in CS4. I don't remember what is happening with the change table in CS3. Any help is greatly appreciated.

    I am not fond of the tables. Never been able to do the table styles work properly.

    My method to treat stroke selct the cells and use the proxy in the control panel to set the stroke or STROKE I want to edit, and then change the attirbutes. I find sometimes that I need to change the weight, sometimes the type of stroke, or sometimes even both. If you have applied a troke to a cell that is shared with another, then go in the other cell, I find that you must explicitly choose this feature again to change.

  • Import Illustrator doc with layers in InDesign

    I'm doing a tutorial on creating a new document in Illustrator or Photoshop and save the doc in InDesign with the layers. When the doc comes in InDesign, it has only one layer. I choose object > object Layer and the layers are all there, but they do not appear in the display. The original doc was created in Illy CS3 in WinXP and put in an empty doc opened in InDesign CS3. Any help?

    I thought I had book Sandee, but I can't put my hands on it. I wonder if you had misinterpreted what she said, that is, you can create different layers with different colors in a single file, then use the layer visibility options to access regardless of the version that you need without having to re - import.

    Actual installation of the imported file must be done in the editor appropriate, sorry.

  • Display the stream RSS XML with XSLT

    Working with an old server on a host and it doesn't support XSLT.
    They tell me that they have no intention to upgrade (currently PHP 4.4.1 Version)
    Is there another way to display the RSS feed without XSLT? (it's the customer's hosting company so I can't change the hosts hassle)
    Page fragment created using Dreamweaver XSLT from David powers book "Dreamweaver CS3... »

    Thanks for your help,
    Jim Balthrop

    Thanks for your reply, David.

    I sent the following to the host company, e-mail namesecure.com

    "I'm working on a web site.
    topgunpropertygroup.com
    for the owner, Andra Morgan and have run into several issues where his website could be better if you, like the hosting company had a longer platform to date.
    You are running Version 4.4.1 of PHP which has not been supported since August 2008. PHP 4.4.1 was released in October 2005 and contains many bugs and security vulnerabilities.

    Please respond to this and several other areas on your server owner.'

    I didn't know if I could mention your name or not?

    Thanks again,
    Jim balthrop

  • Styles to import an xml file

    Hello

    I tri to import an xml with CS5 file formatting:

    <? XML version = "1.0" encoding = "utf-8"? >

    " < root xmlns:aid5 =" http://ns.Adobe.com/AdobeInDesign/5.0/ ">

    < title aid: pstyle = "head_large"> van Gogh art show < /title >

    < / root >

    or
    < root >

    < title aid: pstyle = "head_large"> van Gogh art show < /title >

    < / root >
    but he made a mistake "Prefix of the namespace not related."
    (Help Namespace prefix for pstyle on the title is not set)
    What have I forgotten?
    Thank you

    I think that you need a statement for the namespace aid in addition to the aid5 namespace xmlns .

  • Importing XML with graphics issues

    I am importing an xml document in FrameMaker 11. I have a DTD, model, read/write rules and an installer of the XSL stylesheet in the structapps file. I have problems referencing the graphics. My XML is:

    < m ultisheet > < chart boardno = "FileName" / > < /multifeuille >

    I need is:

    < multifeuille >< boardno graphic "figures/FileName.cgm" = ></multifeuille >

    My XSL is:

    <? xml version = "1.0" encoding = "UTF-8"? >

    " < xsl: stylesheet xmlns: xsl ="http://www.w3.org/1999/XSL/Transform"version ="1.0"> "

    < xsl: strip-space elements = "*" / >

    < xsl: template match = "node () | @*" >

            < xsl:copy >

    < xsl: apply-templates select = "node () | @*" / >

            < / xsl:copy >

    < / xsl: template >

    " < xsl: template match="multisheet/graphic/@boardno ">

    < xsl: attribute name = "boardno" >

    < xsl: value-of select = "concat ('figures\',., '.cgm')" / >

    < / xsl: attribute >

    < / xsl: template >

    < / xsl: stylesheet >

    My read/write rules:

    "widget"

    {

    FM widget 'graphic';

    'boardno' attribute is the property of fm; file

    'content' attribute is "content of attribute"; fm

    }

    With this configuration, I am not able to see my drawings in FrameMaker, any help would be appreciated.

    Halfeye,

    With a quick look, as well your rules of r/w and your XSLT code look OK to me. What error messages do you get when you open the file? I guess that there are messages on the graphics. Did give any useful information? For example, can you tell if FM is looking for them in the right directory?

    The first thing I would do to debug an application such as this is to confirm that both the rules of r/w and pre process are treated. Try to rename the two files and try the import again. If you receive no error messages not being able to open these files, or FM is not using the appropriate application or the application is not set correctly.

    Once you have verified that the two files are used, I suggest running the XSLT regardless of the import. You can do this in XML mode or in another XSLT processor. The output looks similar to the way that you expect? Otherwise, use a XSLT debugger or put in some debugging statements.

    -Lynne

  • XML with Indesign!

    I'm trying to set up an automatic import of XML in Indesign. Here is a list of long products price. But so far, I try with a very short excerpt to see the result, and I do not get the desired result.

    I would like to know what to do in Indesign, in my case, in order to place the data correctly, or if you see my XML structure is not the ideal XML for Indesign document (it has attributes in addition to the tags), you could help me optimize it.

    Here are two screenshots that I made that illustrate my case:

    http://img20.imageshack.us/img20/2348/screenhunter02may230748.jpg

    http://img20.imageshack.us/img20/4848/screenhunter01may230742.jpg

    Notice that the three lowest tags (product, our_price, retail_price) light up on the same line, and I separated them with tabs.

    Any help would be appreciated kindly.

    If an element is repeated in the XML, where repeated items simply reproduce at the same level in the structure, InDesign will be 'clone' its equivalent, in the relevant part of its structure. So as long as the number of repetition of elements in the XML file is "arbitrary" (rather than the level of these elements in the structure), InDesign will follow, without any additional direction. This will become clearer to you more you practice import XML.

    That's the best I can do - good luck with it - Jeremy

  • My IllustratorCS4, iMovie and iNdesign CS4 that came with my computer when I bought it about 4 years ago does not work after I was informed by a representative of Adobe until this day my computer. I still have the programs on my computer. How can I get re

    My IllustratorCS4, iMovie and iNdesign CS4 that came with my computer when I bought it about 4 years ago does not work after I was informed by a representative of Adobe until this day my computer. I still have the programs on my computer. How can I get the re install

    If you're ready to uninsntall, then reinstall, you can download at the bottom of the link;

    Download the CS4 products

  • How to place an image inline with the text using InDesign CS4?

    I'm writing the first draft of an instruction manual how two for some software.

    I'm writing the manual directly in InDesign CS4 and making screen shots that I'm making progress. I format the screenshot in Photoshop and export it to a JPG file.

    In InDesign, I double-click in the text box where I want to insert the image, go to file > place, get the picture, then press on open.

    Usually InDesign inserts the image at the cursor flashing in the text, but sometimes what happens is that no picture inserted and everything after it disappears. I get several empty text boxes and need to Control-Z to get back to where I started.

    Now I can put the image outside the text box and then manually move it to the text where I want to go, however when I export the file as HTML, then I need to manually move it to the appropriate area in Dreamweaver (when the image is placed inside the text box to the flashing cursor, the HTML file shows the image in the right place).

    I was able to insert the line in file with the text to a new paragraph mark, but sometimes InDesign doesn't let me do. Sometimes it does, sometimes it doesn't.

    I don't know what I'm doing to prevent it from placing the paragraph mark and the blinking cursor (which is where I want it to appear).

    This is a recording of screen 54sec of my actions:

    http://storytechnician.com/temp/idcs4-place/

    Steps to follow:

    I double-click inside the text box

    I place the image

    everything goes

    I have a few pages scroll, and then return to the starting point

    I have to scroll through a page or double-click inside the text box then press return a few times, and the previous image, I put in this way is automatically pushed to the next page.

    I go back to point of original departure, try again, and it does not work.

    I've done it before, but now it does not work. I don't know what's happened prevents him from online to the location of the cursor.

    Help, please.

    Thank you

    It seems to me that the image is too wide for the frame. You can place it on the editing table, scale in the size, then cut to the Clipboard and paste it into the flow of the text.

  • InDesign CS4 crashes when converting 1-column text box with a drop shadow to the col-2 (or more)

    I use InDesign CS4 in Windows XP Pro 64-bit, 6 GB of RAM. If I create a column 1 text box, fill it with a color, add a drop shadow, and then add text, everything is fine. If I try to change it to 2-columns (or), InDesign freezes/crashes. I thought at first that it is perhaps because the case was shot, but it happens even if the case is not turned. If I remove the shadow and try to change it, it works.

    Anyone know why this is happening or if there is a known bug or fix?

    Thank you

    Lloyd Lathrop

    XP 64 is totally supported. No troubleshooting should begin there.

    Bob

  • Unable to import the article with sidecar.xml

    Hello

    With the new version of DPS (worm. 18), we are not able to import the article with sidecar.xml. Could you please check and suggest the solution for the same.

    With respect,

    Anil yannick

    And you need the latest version of the Folio Builder plugin (mine was just a 'bit' older and did not work; did only after the upgrade to 1.1.9.1 (ranked in all 7.5.5.18 - 676053))

    KlaasJan Tukker

    Adobe Systems

  • Importing of XML in Indesign text friendly "carriage returns.

    Hello
    I have a question regarding the import of XML in Indesign.  I have my text stored in Excel (Fig A) and intend to export to an XML file, where each line will represent each page.  However, my first attempt failed process "cart returns" I had considered:
    "Carriage returns" used within a cell in Excel (ALT + ENTER) are preserved during the transformation to a CSV (fig. B).  However, when converting a file XML, the conversion takes place on a line-by-line, and therefore, the XML file becomes incomplete (Fig C).

    So it seems, I need to make sure that the CSV file contains one line per entry, while maintaining the real transport returns in my spreadsheet source and for Indesign to recognize.  To do this, I'll need to substitute "carriage returns" in my excel column to be represented by a new set of characters.  My question is how can I let Indesign can recognize this set of characters to be converted to a carriage return, importing text.
    For example, if the character set has been ' %% ', then my new csv file would look like Figure D and XML would be produced correctly, as the Figure E.  Then import this XML file into InDesign, return transport would be automatically restored, if all goes well.

    I hope someone can help me because I am only starting in Indesign and feel Im running until I can walk by embarking on the XML/Indesign arena too early.
    Best regards
    Luke
    XML_ReturnIssue.JPG

    No, I don't think.

    The fact is that ^ is a special character to find/replace.

    so you should either avoid its use in search strings to avoid confusion.

    or if you agree the confusion, you must use ^ ^ n to search for

    (instead of ^ n).

  • Adobe Indesign CS4 will not work with windows 7, work stoppage

    InDesign CS4 does not work with Windows 7

    InDesign CS4 stop working on Windows 7, we have Vb 6 application that opens Indesign cs4 to create multi-page document.

    but after a few Indesign CS4 pages stop working, if we run the same with version CS3 on Windows 7 it works fine.

    and if we use Indesign CS4 with Windows Xp, it works but create problem with Windows 7.

    You must have a configuration problem on your system.

    6 inDesign (CS4) works perfectly well on the 32-bit and 64-bit Windows 7 versions. Many users as same Adobe employees use or have used this version of InDesign in these environments of operating system without problem that it is associated with the operating system.

    -Dov

Maybe you are looking for