Skip navigation
Currently Being Moderated

How can I combine XML info into HTML/ePub export?

Dec 29, 2012 12:37 PM

I'm creating a workflow that exports large InDesign documents to a complex online eDocument system.

 

The documents contain highly formatted chunks of content with no automatic semantic (meaning/purpose) markup.

 

It looks like I can add structure tags through a variety of means, to provide the semantic meaning (styles->tags, scripts, grep styles, plus some manual effort).

 

My problem is: how do I inject the structure/tag info into the output?

 

I've tried exporting according to XML (tag) structure. That appears to successfully define the sequence of output, but none of the actual tag structure shows up in the output (in either EPUB or HTML output).

 

What would be ideal would be if I could export to HTML or ePub and surround content chunks with <div> tags marked up with the tag names.

 

But right now, I'd be happy for any export format that gives me the HTML content, and XML/tagged semantics.

 

Anybody have any ideas?

 

Thanks so much,

Pete

 
Replies
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Dec 29, 2012 7:15 PM   in reply to SLTyPete

    The intended use of this feature (XML tagging) is for InDesign's XML export, not EPUB or HTML export.

    So...you are not in a good situation.

     

    If you have a sufficiently advanced workflow, you may be able to translate the XML export (or also potentially InDesign's IDML export, but that is much more complicated) into what you want from EPUB or HTML.

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Dec 29, 2012 8:44 PM   in reply to SLTyPete

    Well, I'm not the right person to talk to for EPUB and HTML exports, so don't pay too much attention to me, but …


    InDesign's EPUB and HTML export functions just do not give you a lot of direct control over the code that implements the markup. If you are expecting that, you are going to bang your head against the wall and be sad, over and over and over again.

     

    What version of ID are you using? There have been a lot of changes (though I think none of them particularly help you).

     

    If I were you, I think I would probably postprocess the output file. Convert all <h1>foo</h1> to <div class="Topsection"><h1>foo</h1></div> after InDesign outputs whatever file format you want. This has the advantage of not complicating your InDesign user experience (and thus reducing errors), and actually working.

     

    If you want to use XML export, though, you can achieve what you want. Just make a div tag and in the Structure pane, after applying it, Control-click on it and choose New Attribute and set class to Topsection. Then within make an h1 tag. This will let you apply all the markup in InDesign, but it sounds incredibly painful.

     

    Though maybe your content is coming from somewhere else?

     
    |
    Mark as:
  • John Hawkinson
    5,572 posts
    Jun 25, 2009
    Currently Being Moderated
    Dec 29, 2012 10:18 PM   in reply to SLTyPete

    Your postprocess example unfortunately doesn't work: it simply puts a div around the H1 itself rather than the H1 plus everything up to the next H1.

    Sorry, yes, I got that wrong.

    But it doesn't invalidate the idea of postprocessing. It just makes it (a little?) more complicated.

     

    Good luck.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points