3 Replies Latest reply on Nov 20, 2012 7:29 AM by SimonLinden

    Conventions for XML-files

    SimonLinden

      Hi!

      I'm working on the text of a Bible translation that will be quite an extensive file when it's finished. The publisher has requested that I make an XML file in addition to the print-ready inDesign files they will use themselves. This is because there will be other publishers and companies that will want to use their translation (or parts of it) and it's inconvenient to send them inDesign files. An XML file with all of the paragraph styles, character styles and footnotes would be more convenient.

       

      Now, I've been trying to find information on how such a XML should look. Are there any code conventions for it? Most of the issues on this forum concerns importing xml files for use in indesign - but what I'm wondering is what I must think of when exporting XML files that other people will use?

       

      Also, is it possible to create inline xml tags based on character styles? (Such as bold, italic, suberscript etc.)

       

      I'm using CS6 and Mac OS X Lion.

       

      EDIT: Another thing just struck me. If anyone thinks that XML is not the best format for this then I'd very much like to hear about any other suggestions.

        • 1. Re: Conventions for XML-files
          [Jongware] Most Valuable Participant

          InDesign has a native "Export XML" option, but that requires that you tag each separate item as an "XML item". Some of this can be automated, using "Map Styles to Tags". I don't have any experience with it, positive or negative, but if you exclusively used paragraph and character styles to layout your text it should be straightforward.

           

          Fastest way to get re-usable text in a not too difficult to parse file format is to export as Tagged Text. It's not really proper XML, but it may be Close Enough; if the above route is too complickated, try this (and send your publisher a test file).

           

          SimonLinden wrote:

           

          I've been trying to find information on how such a XML should look. Are there any code conventions for it? Most of the issues on this forum concerns importing xml files for use in indesign - but what I'm wondering is what I must think of when exporting XML files that other people will use?

           

          There are no "conventions". XML itself only has some very basic requirements (the way of writing element and attribute tags, correct nesting, some special characters that may not be used in plain text; that sort of things). So you can make up your own set of tags, or, to not confuse your receiving party, use a well-known set of tags such as XHTML (ie., <p> is for Paragraph, <i> is for Italic, and so on) or DocBook. There are also Scripture specific schema's of XML; http://ebible.org/usfx/ is one found with a quick Google.

          • 2. Re: Conventions for XML-files
            David W. Goodrich Level 3

            You might find some useful hints about both footnotes and XML in the 2011 thread Footnotes not support with XML?;  for footnotes in particular, note Jongware’s contribution.  Wandering off topic, David Blatner’s recent This Week in InDesign Articles, Number 99 links to a discussion “Has XML failed book publishing?”

             

            David

            • 3. Re: Conventions for XML-files
              SimonLinden Level 1

              Thanks for your reply. I had no idea that these XML schemas existed. I've been looking closer at both OSIS and USFX (which you linked to). A problem for me with both of these standards is that some information that should be included in the text is instead included as attibutes in tags. Normally in the Bible you will have a verse number (usually in superscript) followed by the text in that verse. These standards include chapter <c> and verse <v> numbers like this:

              <c id="1" />

              <p><v id="1" />In the beginning God created the heavens and the earth.

              <v id="2" />...

              </p>

               

              Is there any smooth way to import this structure into inDesign and transform the attributes of the <c>-tag and <v>-tag into numbers with a given character style? Also can you do the opposite when exporting to XML (converting text of a given character style into an attribute)?