XML in Indesign

Hi everyone,
I'm using the xml features in indesign to create an online version of a book. In this online version, the first level headings in the table of contents (which list the chapter names) will act as a hyperlink to the xhtml page that it links to. I can tag each of the table of contents entries with an xml tag using the tags panel but I'm trying to find a way to automatically add an attribute to all these "first level" tags so they can act as anchor tags when it finally reaches the xhtml stage.
At the moment I can click on the tag in the structures pane and then choose "new attribute" from the flyout menu but I'd have to do this for each of the tags that represent first level headings throughout the document. This would mean I'd have to do it about 50 times since there are that many chapters in the book.
Is there a way to target a group of discontiguous tag names and apply an attribute to all of them at once (as they will all have the same attribute name and value pair and will be changed programmatically via xml programming)?
Or is there a way to import a tag into the tags panel that already has this attribute applied?
Appreciate any assistance.

The correct way to address this issue is to use an XSLT transformation. However, since the learning curve on XSLT is so steep, you might try adapting the following script in Script Editor. This is a Mac only solution
--Script adapted from a script by bengt on macscripter.net
--tagList {}
--set tagList to {"tag1, tag2, tag3, etc.}
tell application "Adobe InDesign CS3"
    tell active document
        set theRoot to (item 1 of XML elements) -- the root element
    end tell
end tell
myLoopLoop(theRoot)
on myLoopLoop(myElement)
    tell application "Adobe InDesign CS3"
        tell active document
            --if (name of markup tag of myElment is in tagList then
            if (name of markup tag of myElement contains "Chapter") then
                tell myElement
                    make XML attribute with properties {name:"yourattributename", value:"yourattributevalue"}
                end tell
            end if
            set moreElement to every XML element of myElement
            repeat with x from 1 to (count of moreElement)
                tell me to myLoopLoop(item x of moreElement)
            end repeat
        end tell
    end tell
end myLoopLoop
Greg Ledger
Mac Production Artist Tips and Scripts
http://www.macproductionartist.wordpress.com

Similar Messages

  • XML to InDesign, multiple versions of the same document

    Hi everyone,
    I have a small project that I need help with.
    I am working on an online survey for a client of mine; which consist of 10 odd pages of questions as well as free text entry on some of the questions. Some of the questions requires number input which then converted into charts (bar graphs etc.) Survey is done as a web app (using .NET and C# and MySQL) and resulting data converted into XML format in order to generate a report based on the answers that the members provide.
    Currently XML data is imported into MSWord and report is generated as .docx file.
    Client is not happy with the presentation of the word so I suggested that we can use InDesign to have a better look/feel of the report, using the same XML structure.
    There are 1000+ members that need to take this survey, which means that report has to be generated for each client individually (different answers, total page numbers, branding and so on.)
    I understand the basics of generating a book from XML to InDesign but I can't figure out how can I apply this workflow into producing 1000+ different copies.
    Do I need to have 1000+ InDesign documents with SAME XML structure but DIFFERENT branding (different heading colours etc.) or is there a way to generate the reports with using a single InDesign template, supplying each member's survey results as a separate XML file and generate the report.
    It would be great to know if the process can be automated such as :
    - Saving all the XML files (Survey answers) in a folder
    - Save all graphs for each client in a separate folder (e.g. /client_name/graphs)
    - Open InDesign and select the XML source file <- This is where I stuck. I can only imagine doing this work for every single member
    - Generate reports (saving as PDF documents)
    I'll be happy to answer if you have any questions or need clarification.
    Any suggestions welcome
    Thanks

    You probably want to look at InDesign's Data Merge feature.
    Unfortunately it won't accept XML directly, so you'll have to convert your XML to CSV or TSV. But that's pretty easy to do.

  • Do you need to generate HTML table rows from XML in InDesign?

    General issue: you export XML and you get a bunch of content for xml elements that were a table in inDesign. But they don't have any rows, just cell after cell. What will make rows in your output?
    Solution: XSLT; you need to use the @aid:tcols attribute of exported XML to determine the number of columns that your table should be. This is written in XSLT 1.1 so it shoud work with an export from InDesign. If you have problems with using it on export of XML, try using it on the XML afetr it has been exported, in Oxygen or other XSLT processor. Best to save acopy of your files before using the XSLT with them.  Copy all of the plain text and past into a new file, save with your own filename, ending with .xsl file extension. Then when exporting XML from InDesign CS3-5, browse to your new .xsl file and select it. PLEASE read about XSLT files at w3c.schools or other resource if you want to understand what is going on with this file.
    BTW <!-- indicates comments in code -->
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- NO WARRANTY that this example code will work as written for your XML file in InDesign. You can add more templates to the output to map your heading styles to h1, h2, etc. -->
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"
        xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/"
        xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" exclude-result-prefixes="xsl aid aid5">
        <xsl:output method="html" indent="yes" encoding="UTF-8"
            doctype-public="http://www.w3.org/TR/xhtml/DTD/xhtml-transitional.dtd"/>
    <!-- parameter to use the name of element with attribute aid:theader as the th output -->
        <xsl:param name="tableElem">//*[local-name()][@aid:table='table']</xsl:param>
        <xsl:param name="colheadStyle">
            <xsl:value-of select="//*[local-name()][@aid:theader][1]"/>
            <!-- i.e. colHead-->
        </xsl:param>
    <!-- parameter to use the name of element with attribute aid:cell but not aid:theader as the td  output -->
    <!--i.e. tabletext or whatever the name of your Cell level  element is in InDesign -->
        <xsl:param name="cellStyle">
            <xsl:value-of select="//*[local-name()][@aid:table='cell' and not(@aid:theader)][1]"/>
        </xsl:param>
        <!-- handles a Story element marked up with HTML-type elements, but uses the <Table> element of IDD  -->
        <!-- if a true HTML table is in the content, it will be passed through -->
        <xsl:template match="Story"><!-- make a basic HTML file from a Story -->
            <html>
                <head>
                    <title>Sample Table</title>
                </head>
                <body>
                    <xsl:apply-templates><!-- will handle direct text of the  <Story>, and <Table> -->
                        <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                        <xsl:with-param name="cellStyle" select="$cellStyle"/>
                    </xsl:apply-templates>  
                </body>
            </html>
        </xsl:template>
       <!-- use the styles to find the elements of IDD <Table> element -->
        <xsl:template match="Table">
            <xsl:param name="colheadStyle">
                <xsl:value-of select="$colheadStyle"/>
            </xsl:param>
            <xsl:param name="cellStyle">
                <xsl:value-of select="$cellStyle"/>
            </xsl:param>
            <xsl:variable name="cellsPerRow">
                <xsl:value-of select="@aid:tcols"/>
            </xsl:variable>
            <table><!-- start the table -->
                <!-- xhtml requires lower-case name for table element-->
                <tr>
                    <xsl:apply-templates select="*[@aid:theader='']">
                        <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                        <xsl:with-param name="cellStyle" select="$cellStyle"/>
                    </xsl:apply-templates>
                </tr>
                <!--  and @aid:style=$cellStyle -->
                <xsl:for-each
                    select="*[@aid:table='cell'][not(@aid:theader='')][position() mod $cellsPerRow = 1]">
    <!-- some code adapted with  permission, from http://www.computorcompanion.com/LPMArticle.asp?ID=202
    Building HTML Tables with XSL by James Byrd; please include this acknowledgement in all files that use his code -->
    <!-- this is the tricky bit of the code that James Byrd set up
    p-class-tabletext-[position() mod $cellsPerRow = 1 continues looping until the position of the active element divided by $cellperRow (@aid:tcols value) tried with [@aid:style=$cellStyle] has a remainder of 1 -->
    <!--  .|following-sibling::p-class-tabletext-[position() &lt;  $cellsPerRow] applies first to the currently selects cell with "." then continues with the following-siblings whose position is less than  the value of cells per row (@aid:tcols value) -->
                    <tr>
                        <xsl:apply-templates
                            select=".|following-sibling::*[@aid:table='cell'][not(@aid:theader='')][position() &lt; $cellsPerRow]"
                        />
                    </tr>
                </xsl:for-each>
            </table>
        </xsl:template>
        <xsl:template match="*">
            <xsl:param name="colheadStyle">
                <xsl:value-of select="$colheadStyle"/>
            </xsl:param>
            <xsl:param name="cellStyle">
                <xsl:value-of select="$cellStyle"/>
            </xsl:param>
            <xsl:variable name="cellsPerRow">
                <xsl:value-of select="parent::Table/@aid:tcols"/>
            </xsl:variable>
            <xsl:choose>
                <!-- colHead aid:table="cell" aid:theader=""-->
                <xsl:when test="parent::Table and @aid:theader">
                    <th>
                        <xsl:apply-templates>
                            <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                            <xsl:with-param name="cellStyle" select="$cellStyle"/>
                        </xsl:apply-templates>
                    </th>
                    <xsl:if test="(position() = last()) and (position() &lt; $cellsPerRow)">
                        <xsl:call-template name="FillerCells">
                            <xsl:with-param name="cellCount" select="$cellsPerRow - position()"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:when>
                <xsl:when test="parent::Table and @aid:table='cell' and not(@aid:theader)">
                    <td>
                        <xsl:apply-templates>
                            <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                            <xsl:with-param name="cellStyle" select="$cellStyle"/>
                        </xsl:apply-templates>
                    </td>
                    <xsl:if test="(position() = last()) and (position() &lt; $cellsPerRow)">
                        <xsl:call-template name="FillerCells">
                            <xsl:with-param name="cellCount" select="$cellsPerRow - position()"/>
                        </xsl:call-template>
                    </xsl:if>
                </xsl:when>
    <!-- for non-table elements this generic element handler will  pick up an aid:pstyle (if present) and create a class attribute from it. Works for any element that has the same name as HTML element such as <p> but it doesn't add wrapper elements like <ul> or <ol> for lists. -->
                <xsl:otherwise>
                    <xsl:element name="{name()}">
                        <xsl:if test="@aid:pstyle">
                            <xsl:attribute name="class">
                                <xsl:value-of select="@aid:ptyle"/>
                            </xsl:attribute>
                        </xsl:if>
                        <xsl:apply-templates>
                            <xsl:with-param name="colheadStyle" select="$colheadStyle"/>
                            <xsl:with-param name="cellStyle" select="$cellStyle"/>
                        </xsl:apply-templates>
                    </xsl:element>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
        <!-- take care of text that is a direct child of the <Story> by wrapping it in a <p> to make valid HTML -->
        <xsl:template match="text()">
            <xsl:variable name="myString">
                <xsl:value-of select="string-length(normalize-space(.))"/>
            </xsl:variable>
            <xsl:choose>
                <xsl:when test="parent::Story">
                    <xsl:if test="$myString > 0">
                        <xsl:element name="p">
                            <xsl:attribute name="class">text</xsl:attribute>
                            <xsl:value-of select="normalize-space(.)"/>
                        </xsl:element>
                    </xsl:if>
                </xsl:when>
                <xsl:otherwise>
                    <xsl:value-of select="normalize-space(.)"/>
                </xsl:otherwise>
            </xsl:choose>
        </xsl:template>
       <!-- make br element conform to good HTML markup -->
        <xsl:template match="br">
            <br />
        </xsl:template>
        <!-- this recursive template calls itself until its test condition is satified -->
        <!-- it outputs a cell whose only content is a non-breaking space -->
        <!-- do not use   in place of Unicode &#160; for the non-breaking space -->
        <!-- the value of $cellCount is set in the main XSL template -->
        <xsl:template name="FillerCells">
            <xsl:param name="cellCount"/>
            <td>&#160;</td>
            <xsl:if test="$cellCount > 1">
                <xsl:call-template name="FillerCells">
                    <xsl:with-param name="cellCount" select="$cellCount - 1"/>
                </xsl:call-template>
            </xsl:if>
        </xsl:template>
    </xsl:stylesheet>
    Message was edited by: HoneoyeFalls
    Sample XML file exported from IDD
    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <Story><Table xmlns:aid="http://ns.adobe.com/AdobeInDesign/4.0/" xmlns:aid5="http://ns.adobe.com/AdobeInDesign/5.0/" aid:table="table" aid:trows="2" aid:tcols="2"><colHead aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="44">1 colHead</colHead><colHead aid:table="cell" aid:theader="" aid:crows="1" aid:ccols="1" aid:ccolwidth="56">2 colHead</colHead><tabletext aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="44">1 tabletext</tabletext><tabletext aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="56">2 tabletext</tabletext><tabletext aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="44">row 2 1 tabletext</tabletext><tabletext aid:table="cell" aid:crows="1" aid:ccols="1" aid:ccolwidth="56">row 2 2 tabletext</tabletext></Table>
    <table><tr><th>normal HTML table heading</th></tr>
    <tr><td>normal HTML table<br/>cell text</td></tr></table></Story>

    You can use RECORD type declaration:
    SQL> declare
      2   type rec_type is record (
      3    ename emp.ename%type,
      4    sal emp.sal%type
      5   );
      6   type rc is ref cursor return rec_type;
      7   rc1 rc;
      8   rec1 rec_type;
      9  begin
    10   open rc1 for select ename, sal from emp;
    11   loop
    12    fetch rc1 into rec1;
    13    exit when rc1%notfound;
    14    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    15   end loop;
    16   close rc1;
    17  end;
    18  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300or use, for example, VIEW to declare rowtype:
    SQL> create view dummy_view as select ename, sal from emp;
    View created.
    SQL> declare
      2   type rc is ref cursor return dummy_view%rowtype;
      3   rc1 rc;
      4   rec1 dummy_view%rowtype;
      5  begin
      6   open rc1 for select ename, sal from emp;
      7   loop
      8    fetch rc1 into rec1;
      9    exit when rc1%notfound;
    10    dbms_output.put_line(rec1.ename || ' ' || rec1.sal);
    11   end loop;
    12   close rc1;
    13  end;
    14  /
    SMITH 800
    ALLEN 1600
    WARD 1250
    JONES 2975
    MARTIN 1250
    BLAKE 2850
    CLARK 2450
    SCOTT 3000
    KING 5000
    TURNER 1500
    ADAMS 1100
    JAMES 950
    FORD 3000
    MILLER 1300 Rgds.

  • Can you use complex DTDs to produce XML in InDesign?

    I'm working on a scientific publication with a DTD similar to that of NLM/Pubmed for upload to our own site and PubMed. We are working with an InDesign/InCopy workflow.  Can InDesign handle this complicated DTD or does it only handle standard XML such as fonts, heads, paragraph tagging?

    This Help topic discusses DTDs in InDesign. This site on Adobe.com also has a section on XML resources. If you're going to be working with XML in InDesign, I recommend A Designer's Guide to InDesign and XML.

  • Import XML to InDesign

    New to XML in InDesign, I have a few question, so if you only can answer one or two, please do so.
    1. Is there a way to get InDesign to display in the structure the content of the tag, rather than the tag name over and over again?
    2. Can you make a search in the Structure, XML file in InDesign? I know once you have it on the page you can show where it is in the structure, was looking for the same function vice versa.
    3. We get the data from the App developers, and the data is very messy, lots of spaces, returns etc, which seems legit for the digital version, but in InDesign we have to clean all this up, so when we reimport the data every time with updated content, we have to go through and apply all those manual changes again. What wold be the proper way to tackle this?
    4. When we update the XML file later, do we have to update the whole file, or can you specify which section you want to update. Because we do a lot of Typography after inporting, i assume we have to redo this once the XML gets updated.
    5. What happens with all the duplicats? Every time you copy and paste a content group, new XML entries, also when you duplicate a page.
    Thanks, Dimitri

    1. Turn on "Show Text Snippets" to display the beginning of text.
    2. Double click an xml-element in the structure pane or right-click and "Go to item"
    3.  You can clean up the text in the layout with grep find-replace queries (there are scripts that allow make a series of queries in one go). And by script it's possible to clean up xml-elements themselves – e.g. remove returns from certain elements
    4. As far as I know, you can only merge or append xml-file. You may want to import xml-file as external link and edit it in another app, but I think you’ll lose formatting in InDesign after updating.
    5. Xml-elements are duplicated as well.

  • Products, list of elements and XML in Indesign

    Hi,
    I want to do something with XML in Indesign, but I can't find the solution
    I have a list of product, and each product is composed of multiple elements, just like that :
    A product can be made for exemple like that :
    Product 1    :  - P2O5 : 23 g/L
                        - CaO : 1,2 g/L
                        - Zn : 3,2 g/L
    Product 2    :  - N : 4,3 g/L
                        - MgO : 2,2 g/L
    I want only elements (when I say "element", I want to say Chemical element) that have a face value when I import my XML, and not the other (for exemple, not the term "B", "Cu", ...)
    My XML has the value of the elements (for exemple, 23 g/L, 1,2 g/L) but not the term "N", "Cu", ... (it's a static text, directly typed into an anchored object in Indesign)
    I want the term "P2O5" or "CaO" to appear only when there are a face value, but disappears when there are no face value.
    And I want the elements not to be too spaced one to each other (for exemple, if there not N, P2O5 and K2O elements in my product, the term "MgO" and its value reach back instead of the term"N" (see in my picture above)
    For exemple, in this picture (done manually), there is too much space before "CaO : 560", and between "CaO : 560" and "Mn : 8,8"
    So, how can I create a document into Indesign with XML (much like in my exemple), wich generates list of products with differents elements that appear or disappear according to their values?
    I don't know if my XLM tags are right or not, or if I use the right strategy with anchored blocks instead of a single block of text, but I don't find the solution!
    Can someone help me?
    I work on Indesign CS6, on Windows 7.
    Thank you,

    Hello Fabien,
    I have had a chance to look at the files. I am a bit uncertain about something. Is the table a design element, or do you want the data in a table?
    If you do not want the data in a table, let me know.
    If you do want the XML in a table, there are a couple means of achieving that. I don't know how big this publication is going to be, and so the answer sort of depends upon that. So a general "rule" I follow is:
    For product data sheets or publications of say 12 pages or less, I will simply arrange my XML so that the data is in rows with the data that will be in a row's cells separated by tabs. I will typically bring in a small amount of data, create the table and create table and cell styles for quickly formatting the data into tables once inside ID. I use the Text to Tables feature for these, then apply the table style(s).
    For a bit bigger publication, I will create a CALS table structure in the XML and do the same as above as regards applying table/cell styles.
    For a large publication where manually going through and applying the table styles would be onerous and or there are several table styles I would need to use, I *might* take the time to wrap the XML table data in an ID table structure. To see what you would be up against, create and style a table and export it out as an XML file. This, to me, is only worth doing on a really large file that perhaps includes several styles of tables.
    Using your example XML, it would look similar to the below. Depending on your text editor, it doesn't take too long to use the search/replace function in a good editor to do once you know how it needs to be laid out and your familiarity with the editor. I began with importing your XML into Excel rearranged some data, exported back out to XML and cleaned it up. I don't know where the data you have is coming from, but if a database of some sort, likely most of this could be done with the export from Access, the SQL, etc. I try to get whoever is providing the XML to get as close as possible to what I need, which takes working with them. But it saves time on my end.
    <?xml version="1.0" encoding="utf-8"?>
    <stuff>
    <table>
    <tgroup cols="5">
    <colspec colname="1"/>
    <colspec colname="2"/>
    <colspec colname="3"/>
    <colspec colname="4"/>
    <colspec colname="5"/>
    <thead>
    <row>
    <entry>Produit</entry>
    <entry>Composition</entry>
    <entry>Forme</entry>
    <entry>Cultures</entry>
    <entry>Doses</entry>
    </row>
    </thead>
    <tbody>
    <row>
    <entry>Produit1</entry>
    <entry>560 g/L
    8,8 g/L
    2,6 g/L</entry>
    <entry>Texte Forme
    Texte Formulation</entry>
    <entry>Texte Cultures</entry>
    <entry>Texte doses
    Texte application</entry>
    </row>
    <row>
    <entry>Produit 2</entry>
    <entry>10 g/L
    50 g/L
    10,2
    27 g/L</entry>
    <entry>Texte forme 2
    Texte formulation 2</entry>
    <entry>Texte cultures 2
    Texte doses 2</entry>
    <entry>Texte application 2</entry>
    </row>
    </tbody>
    </tgroup>
    </table>
    </stuff>
    Take care, Mike

  • Can anyone that works wirth xml in InDesign help me

    I am trying to create a schema to get an Excel workbook into xml so I can take that information and make a member list in inDesign CS6 so I don't have to type it by hand. This is the schema:
    <?xml version="1.0"?>
    <schema xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance">
    <element name="memberList">
        <member>
            <lastname>LastName</lastname>
            <firstname>FirstName</firstname>
            <phone>555-555-5555</phone>
            <streetaddress>streetaddress</streetaddress>
            <city>City</city>
            <state>State</state>
            <zipcode>Zip code</zipcode>
            <email>email</email>           
        </member>
    </element>
    </schema>
    When I bring the schema into Excel, everything seems to be fine except that the top of the tree is wrong in excel. memberList is nott at the top ot the tree. When I pull it over to populate the cells I get no names but when i click on the cell it highlights the proper name in the tree.
    Schema
         element
              name
         member
              lastname
              firstname
              phone
              streetaddress
              city
              state
              zipcode
              email
    Can anyone that works wirth xml in inDesign help me

    I typically get XML from a database, or an Excel sheet without the troublesome XML mapping. Once I simply received an Access database. Access spits out XML in a mostly usable state.
    I use an XML editor that converts the Excel sheet to XML, do any needed transformations, search and replaces, etc in the editor, then save it as an XML I use in ID. The editor is XML Blueprint. I often do other manipulations using UltraEdit as I have long used it for programming and am comfortable with it.
    I did a test in Excel's requisite mapping and found it so cumbersome I didn't successfully get it to export in the 20 minutes it took me to try it. I suspect I could do it with more head scratching but I don't have much hair left.
    But I'll give it another try later today or tonight and see if I can help in the way you want to go about it.
    Take care, Mike

  • Xml with Indesign

    Hello , I have a question : can indesign make a layout from an xml file??? I explain:
    all the info are stocked into a database (advert, text,number of pages etc )  and i create an xml file from the database and can  Indesign  make a layout from this XML file  (suposing that the xml file have all the info needed for indesign) ???
    thanks

    I'm not completely clear on what you're trying to do, cosmicvibs. If what you're asking is whether you can drive the content of an InDesign document with XML, then the answer is that you can. That is to say, given an XML file and an InDesign document with matching XML elements/tags, you can import the XML, and replace the tagged content in the InDesign document with that in the XML file. In this case, Peter (Spier)'s suggestion of creating the desired end result and exporting XML from InDesign to see what your XML structure should look like is an excellent one.
    If you want the XML to drive the content AND the styling of the InDesign document, then this is also possible with the built-in features by creating paragraph and character styles (and also possibly table and cell styles), and then using the Tags-To-Styles Mapping feature. This will cause the mapped styles to be applied to the XML elements that map to them.
    If, however, you are wanting the XML to drive the content, styling, AND form (i.e., create/modify the geometry of pages, frames, etc.), then you will need to at minimum so some scripting to accomplish it. InDesign CS3 and CS4 have a feature called XML Rules which you can look up in the InDesign CS4 Scripting Guide. This feature essentially allows you to define scripted "handlers" to be executed whenever the InDesign XML parser encounters a certain element/condition. So, for example, in response to a <page type="foo"/> element in the xml, a handler might create a new page in the document based on the "C" Master Page, and in response to a <pic source="myImage.psd"/> element, a different handler would create a graphics frame, and place the named image into it.
    This last bit, of course, demands that the XML document have some rather intimate knowledge of the template, so it's generally best practice to create that XML by combining "pure" XML data (as it may be stored in your database) with the template- and presentation-specific stuff that has nothing to do with the abstract data, but is based on the template being used.

  • End footnotes to page footnote in xml flow indesign files.

    Hi,
    I am working with xml files in Indesign, but I had the problem with footnote text, because I need to set the end footnotes to be the page footnote.
    Is there any script to make end footnote to page footnote for XML through Indesign files.
    Thanks
    Hasvi

    In Indesign there is no way you can directly work on the XML-IN footnote, since indesign won't support XML tags in footnote stream.
    To achive that you need to have XSLT/Perl/Indesign Scripting.
    This task is achievable, you can create a auto footnote for XML workflow projects.
    1. Create an XSLT to transform the footnote to the respective places
    2. Change all the "<" ">" to some standard names, since indesign won't accept XML tags in the footnote stream.
    3. Import it in indesign and using script convert it to autofootnote.
    Shaji

  • Validation of XML within InDesign CS5 document using schema (xsd)

    Hi,
    Can any one suggest me how to validate the XML within the InDesign document using xml schema (.xsd) file.
    Can this validation be done within the Indesign like DTD validation.
    Thanks,
    Gopal

    I personally don't work with XML in InDesign too much.
    This link should help you :- http://help.adobe.com/en_US/indesign/cs/using/WS372C59DB-BD13-4806-A399-794E754FF37Aa.html
    look under About DTD file section.

  • [JS] Find & Replace attribute in xml tags (InDesign CS4)

    Hi all,
    Can anyone help me please who i can find and change attribute in xml tags (InDesign CS4) files. I have both link tags but its other attribute different but one attribute same. So who i can change attribute preference.
    (1) one is
    (2) second is
    I want change link preference = 0 but only (2 number,  second) screen shoot. First screen shoot preference = 1 as it is.
    I want this but its manually
    Help me please. Thank you so much adv.
    Regard
    snegig

    Hi John Hawkinson,
    Thank you so much for replay. I am try Jeff, absqua code technique it is simply greet. But my problem is that my both tags link preference = 1 same and other link attribute almost same. So i am unable to change attribute.
    John my code below =>
    var doc = app.activeDocument,
    attNodes = doc.xmlElements[0].evaluateXPathExpression("//link[@preference = '1' or @role = 'generated']"), i, l;
    for (i = 0, l = attNodes.length; i < l; i++) {
    attNodes[i].xmlAttributes.item("preference").remove();
    John please update my code.
    Thank you so much adv.
    Regard
    snegig

  • How can I export a stylesheet (either CSS or XSLT) with XML from indesign?

    Hi,
    I am using indesign CS4. I want to export style sheet whether it is CSS or XSLT file with xml.
    I try to get it but can't.
    Also the XML i am exporting does not styles that has been applied by me while creating the file in Indesign.
    Please help me out by telling me the way how can i get a stylesheet and also how can I embed that style sheet with XML so that my XML file looks similiar to the indesign file.
    Thanks,
    Choudhary Nafees Ahmed

    I am using indesign CS4. I want to export style sheet whether it is CSS or XSLT file with xml.
    CSS is not an XML style sheet, it's an HTML style sheet. "Export to HTML" will export an empty stylesheet for the paragraph and character styles. ID cannot convert its (very advanced) typographic capabilities to the (very limited) CSS notation, and thus it defaults to exporting the names only.
    XSLT is not an XML style sheet either; it's a transformation format (http://www.w3.org/TR/xslt).
    I try to get it but can't.
    Also the XML i am exporting does not styles that has been applied by me while creating the file in Indesign.
    XML Export does not export anything except the items you tagged with the Auto-tag feature, or you tagged yourself. If you need your styles tagged, use Map Styles to Tags (http://www.adobe.com/accessibility/products/indesign/mapping.html).
    XML has almost nothing to do with styling -- ideally, XML describes document structure while styles describe formatting.

  • a tag is creating error in import XML in InDesign CS5.5

    Hi All,
    I am doing upgrade from InDesign CS2 to InDesign CS5.5.
    I have indt file. It has been designed using the CS2 and now converted that indt file into CS5.5 using InDesign CS5.5.
    But I am facing some serious issue while doing export to pdf in CS5.5 version.
    I am following below steps:
    1) Open indt file.
    2) File Menu --> Import XML... [This XML file contains <a href="website link"> html tag]
    3) XML Import Options [no change- defalut options selected]
    4) Ideally it should merge this XML data with the indt file but it is asking me for some input and showing me "Find:" dialog [Check below snapshot]
    I did some research and find out that I am getting this Find dialog because of the <a> tag in XML. when I removed the <a> tag from XML then it didn't give any dialog box and imported XML without any issue.
    I am getting that xml from system and I cant remove the <a> tag from xml manually.
    However I was not getting any error while doing import XML in CS2 version.
    Please can anybody help in this?

    When there is "http://" in anchor tag it will pop up this input window in manual export from indd/indt to pdf and it will failed in export through action script.
    I communicated with the Adobe and it was bug. Adobe has confirmed that they would realease the patch for same sometime later, but I have not heard of anything. I got work around by removing it "http://" using java.

  • XML in InDesign CS2 and Visual Studio 2005

    Hello!
    A year ago I made a plug in to InDesign CS1 with the purpose of importing an XML file and create a lay outed table of its contents. The reason I choose to make a plug in was because I didn't find InDesign very dynamic in its XML support.
    Now I'm being asked to do a similar but more complex solution for InDesign CS2, which I never used before, and I understand a lot has happened since CS1.
    How is the XML support in CS2 now a days?
    And by the way, is there any problems with Visual Studio 2005 and the InDesign SDK that you know of?
    Best Regards
    Kristoffer

    I'm sorry, I posted this thread in the wrong area. I will repost in the InDesign SDK area. My bad.
    Best Regards
    Kristoffer

  • Parsing XML in InDesign

    Hi,
    Suppose I have XML data coming from the network, let's say I'm putting it in a buffer. What's the best way to pass this buffer to InDesign and parse it afterwards to have control over the elements/nodes inside XML document?
    Thanks

    Check out SDK sample XMLCatlogHandler, which implements an XCatHndSAXContentHandler, based on CSAXContentHandler (provides partial implementation to ISAXContentHandler) to read its XML file. for writing out an XML, there is an IXMLGenerator with helper class CXMLGenerator.
    Regards,
    lee

Maybe you are looking for