Skip navigation
karl sirotkin
Currently Being Moderated

Looking for XSLT to import Wordpress XML into InDesign CS5.5

Jun 25, 2012 2:59 PM

Tags: #cs5 #import #xml #indesign_cs5

If I had sample XSLT, because I am familiar with XML and minimally familiar with XSLT, but programming many other languages for decades, I think I could modify it for our situation.  I think we could likely live with converting to almost any style, those details I could manage.

 

Would also love the XSLT to strip out all images...

 
Replies
  • Currently Being Moderated
    Jun 26, 2012 1:38 AM   in reply to karl sirotkin

    Can you post an example somewhere of what your Wordpress XML looks like?

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 27, 2012 2:08 PM   in reply to karl sirotkin

    Uh, "Facebook"? What's that? Does it have anything to do with this "twitter" thing I've been hearing about lately?

     

    (Sorry, just joking. I'm not in to Facebook, LinkedIn, Twitter, Spotify, del.i.cious, or any of the other "social media" advertiser's honey traps.)

     

    Can you make a small sample file that contains no sensitive material and post a public Dropbox link? Or, if the file is not very large, you can also paste it in-line in this forum. In that case please use the Advanced Editor (finally reinstated, thank you moderators!) to set its syntax highlighting to "XML".

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 9:19 AM   in reply to karl sirotkin

    All dropbox content can now be shared with a link.

     

     

     

    Make sure you have the most current version of DB installed and right click the file and choose Dropbox>Get Link.

     

     

     

    You can send a private message to anyone on the forums.

     

     

     

    Bob

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 28, 2012 9:42 AM   in reply to karl sirotkin

    Um, much as I like to help you, I cannot promise anything until I've actually seen the file. It's just that without an example, *no-one* on this forum can.

     

    I could p.m. you an email address, and you could send me your test file, and then I could decide "nah, cannot work with it". That's why I suggested you to make a small (non-sensitive) test file and make it publically available -- so that others can have a go at it as well.

     

    ... The Advanced Editor for posts is hiding under the innocuous text "Use advanced editor", at the top right of your edit window. XML syntax highlight is under the button that looks like ">>".

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 11:08 AM   in reply to karl sirotkin

    Okay, got your sample XML/ePub/PDF files. (It's quite big for a sample; sure looks like you sent the entire thing.)

     

    .. What a mess! If you compare the XML to the PDF, you can see that there is some plain text in there, but it's formatted as HTML, and not everything is formatted. For example, there is nothing special in the XML file between the paragraphs that start with "So it should be no surprise.." and "After arriving at the Blind Sheik's mosque ...", but the PDF mysteriously gained a triple-bullet paragraph divider in there. Where, one wonders, did that come from?

     

    It seems all you need from the XML file is the <title> element, immediately followed by its <content:encoded> element, which contains plain (HTML formatted) text. I had a brief go at it but the header contains lots of weird namespaces, and InDesign's XSLT processor isn't really a very modern one, so all I got was "Could not write data to output". I guess this means that there is some error -- either in my XSLT (which is really extremely basic), or in ID's handling of this XML.

     

    Since you already have a nicely formatted PDF with all proper text in place, I'm inclined it might be faster and easier to export this PDF in Acrobat Pro to a Word .doc file. Then you can clean it up a bit in Word, and use the resulting document as your input for InDesign.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 29, 2012 11:12 AM   in reply to [Jongware]

    Just for clarity, this is my extremely basic XSLT-that-ought-to-have-worked:

     

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
    <xsl:strip-space elements="*" />
    
    <!-- Match everything in the root -->
    <xsl:template match="/">
              <xsl:apply-templates />
    </xsl:template>
    
    <xsl:template name="channel">
              <xsl:apply-templates />
    </xsl:template>
    
    <xsl:template name="title">
              <title><xsl:apply-templates /></title>
    </xsl:template>
    
    <xsl:template name="item">
              <xsl:apply-templates />
    </xsl:template>
    
    <xsl:template name="content:encoded">
              <xsl:apply-templates />
    </xsl:template>
    
    </xsl:stylesheet>
    
     
    |
    Mark as:
  • Currently Being Moderated
    Jul 14, 2012 5:44 PM   in reply to karl sirotkin

    where are the sample files?

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 16, 2012 2:42 PM   in reply to karl sirotkin

    OK, thanks, Karl

     
    |
    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