Professional Web Applications Themes

Exporting XML: Hidden Characters - Adobe Indesign Windows

In InDesign versions prior to CS2, when Mapping Style To Tags, the hidden paragraph tags would export as well, but would be outside my specified XML tags, e.g.: <para>This is my first graf.</para>
 <para>This is my second graf.</para>
 Since these "illegal" characters fell outside of my XML tags, I was able to transform with no problem. Now, with CS2, when I Map Styles To Tags, the same file ends up like this: <para>This is my first graf.
</para> <para>This is my second graf.
</para> The result is that my transform ends up parsing the illegal "
" (which seems to be the marker ...

  1. #1

    Default Exporting XML: Hidden Characters

    In InDesign versions prior to CS2, when Mapping Style To Tags, the hidden paragraph tags would export as well, but would be outside my specified XML tags, e.g.:

    <para>This is my first graf.</para>
 <para>This is my second graf.</para>





    Since these "illegal" characters fell outside of my XML tags, I was able to transform with no problem.

    Now, with CS2, when I Map Styles To Tags, the same file ends up like this:

    <para>This is my first graf.
</para> <para>This is my second graf.
</para>




    The result is that my transform ends up parsing the illegal "
" (which seems to be the marker for a paragraph break) as a "?", so that each "para" ends with a question mark:

    This is my first graf.?

    The only way around it I've found is to individually tag each paragraph, which is way too time-consuming and sort of defeats the purpose of automatically mapping styles to tags.

    Is there any way to get InDesign to leave out the end-of-paragraph markers when exporting XML?

    Thanks!
    Kurt_Morris@adobeforums.com Guest

  2. #2

    Default Exporting XML: Hidden Characters

    In InDesign versions prior to CS2, when Mapping Style To Tags, the hidden paragraph tags would export as well, but would be outside my specified XML tags, e.g.:

    <para>This is my first graf.</para>
 <para>This is my second graf.</para>





    Since these "illegal" characters fell outside of my XML tags, I was able to transform with no problem.

    Now, with CS2, when I Map Styles To Tags, the same file ends up like this:

    <para>This is my first graf.
</para> <para>This is my second graf.
</para>




    The result is that my transform ends up parsing the illegal "
" (which seems to be the marker for a paragraph break) as a "?", so that each "para" ends with a question mark:

    This is my first graf.?

    The only way around it I've found is to individually tag each paragraph, which is way too time-consuming and sort of defeats the purpose of automatically mapping styles to tags.

    Is there any way to get InDesign to leave out the end-of-paragraph markers when exporting XML?

    Thanks!
    Kurt_Morris@adobeforums.com Guest

  3. #3

    Default Re: Exporting XML: Hidden Characters

    I don't see the diffrences you mention. The paragraph breaks are outside the xml tags as the were in CS.

    Teus
    Teus_de_Jong@adobeforums.com Guest

  4. #4

    Default Re: Exporting XML: Hidden Characters

    Dave,

    Thanks. I'm back (too short a vacation <sigh>).

    Stan,

    I don't know what you want to achieve. The purpose of the script was to make cross references like 'see page 44', which are updatable when the doent changes. If you want a PDF that has clickable 'jump points', this will work also if you check 'Include Hyperlinks' when you export to PDF. The only difference would be that you might want to setup the hyperlinks as visible rectangles.

    You'll find the final version of the script, including a tutorial on how to use it, on my home page (click on my name to get there) or with a schortcut here:

    Teus de Jong, "Page References" #13, 6 Aug 2005 6:30 am </cgi-bin/webx?13.3bbb6574/12>

    Teus
    Teus_de_Jong@adobeforums.com Guest

  5. #5

    Default Re: Exporting XML: Hidden Characters

    Is there any way to get InDesign to leave out the end-of-paragraph markers when exporting XML?

    No, unfortunately. You may want to consider implementing some search routines on the XML export to clean up unwanted characters prior to transformation.

    Phil Redman
    pjredman@adobeforums.com Guest

  6. #6

    Default Re: Exporting XML: Hidden Characters

    Phil,

    Do you see the difference Kurt refers to? I don't.

    Teus
    Teus_de_Jong@adobeforums.com Guest

  7. #7

    Default Re: Exporting XML: Hidden Characters

    Teus,

    Look again: The characters that denote an end of paragraph - 
 - in the first example fall *outside* the xml node:

    <node>Stuff</node>
<node>Stuff</node>


    and in the second example, the illegal characters fall *within* the node:

    <node>Stuff
</node><node>Stuff
</node>

    In any event, I'm puzzled as to why - with UTF-8 encoding - that InDesign exports these "end-of-paragraph" markers anyway. Even in the older version of InDesign that displayed and exported the paragraph markers between nodes (which ultimately were ignored in the final output), they were totally unnecessary. I can't imagine any case where one would want that stuff exported.

    Thanks for your replies. I'm still working on a solution so any ideas you may have - well, I'm all ears <g>.

    Kurt
    Kurt_Morris@adobeforums.com Guest

  8. #8

    Default Re: Exporting XML: Hidden Characters

    Kurt,

    Of course I see the characters in your example. What I try to say is that on my machine XML export is handled exactly as it was in CS. Only if I put the closing tag of a paragraph after the paragraph end (the CR at the end of a paragraph) I get what you have got. Normally, this is not the case in the xml I use.

    If it is the case, the paragraph ends can be moved outside the tag by this script:


    travermlelements(app.activeDoent);

    function travermlelements(elm){

    var i;
    for (i = 0; i < elm.xmlElements.length; i++){

    if ((elm.xmlElements[i].characters.length != 0) && (elm.xmlElements[i].characters.length < 9999)){

    s = elm.xmlElements[i].contents;
    if (s.indexOf('\r') == s.length - 1){

    ip = elm.xmlElements[i].insertionPoints[-1];
    ip.parentStory.insertionPoints[ip.index+2].contents = '\r';
    ip.parentStory.characters[ip.index].remove();
    }
    }
    travermlelements(elm.xmlElements[i]);
    }
    }


    Teus
    Teus_de_Jong@adobeforums.com Guest

  9. #9

    Default Re: Exporting XML: Hidden Characters

    I can't imagine any case where one would want that stuff exported.

    These line endings and such are useful if you want to bring the XML back into InDesign while preserving these breaks. I don't think Adobe was thinking about conversion to HTML when they developed XML export.

    Phil Redman
    pjredman@adobeforums.com Guest

  10. #10

    Default Re: Exporting XML: Hidden Characters



    I can't imagine any case where one would want that stuff exported.




    I can. I made several versions of the new Dutch translation of the bible, delivered as xml. After I made the first one and had put the corrections of the text in that one, I exported the xml, made some changes to the structure and imported this corrected version into another layout (indeed importing it into ID again).

    Teus
    Teus_de_Jong@adobeforums.com Guest

  11. #11

    Default Re: Exporting XML: Hidden Characters

    Thanks, Phil and Teus, for sticking with me on this one, and thanks for explaining why those paragraph break characters should be preserved in many instances.

    What I try to say is that on my machine XML export is handled exactly
    as it was in CS.




    I'm trying to get to the bottom of that. It certainly appears to work differently for us, but maybe it has to do with some arcane way that doents are now created.

    I'll try the solution you generously passed along and see if I can't make it work.

    Thanks again to you both!

    Kurt
    Kurt_Morris@adobeforums.com Guest

Similar Threads

  1. Some characters fall out when exporting as EPS
    By Rene_Perales@adobeforums.com in forum Adobe Indesign Windows
    Replies: 3
    Last Post: June 28th, 10:25 PM
  2. Overprint preview and hidden characters
    By Bob_Levine in forum Adobe Indesign Windows
    Replies: 5
    Last Post: June 4th, 08:08 PM
  3. How to stop hidden characters (tabs) appearing in my AI10 pdf?
    By Gill_Keeley@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 0
    Last Post: April 14th, 11:26 AM
  4. Hidden Characters
    By Thomas_Conti@adobeforums.com in forum Adobe Illustrator Macintosh
    Replies: 0
    Last Post: April 6th, 04:29 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139