0

I'm new to Adobe InDesign and have a basic question about importing XML data with an associated XSL style sheet to create a PDF document.

Essentially I have a XML & XSL file that display correctly as a webpage, but I would like to convert the webpage into a PDF document while retaining the internal hyperlinks contained in the XML.

There's two parts to this question:

Firstly, can I use the same style sheet and XML file that is use for HTML web display for InDesign? The reason I asked is because I went through the motions with the import XML hoping that it would work with minimal effort, but only came up with the XSL display in the document, so obviously something went wrong but with my limited understanding I don't know what. Is the style sheet incompatible?

Secondly, would the hyperlinks be retained?

Many thanks!

user5072412
  • 187
  • 1
  • 10

1 Answers1

2

It's a bit hard to state anything here. In the situation where the current xsl file would work with InDesign as it, there are peculiarities in both worlds that won't save you from some efforts. HTML tags won't be interpreted by InDesign.
, or for exemple will only be nodes without specific meanings.

Layout concerns in InDesign will imply that you attach paragraph and character styles to tags or that you add namespaced attributes in the incoming XML with XSLT. Something that you didn't do in your current XSLT. Of course, any CSS you attached in the HTML file is useless with InDesign.

So basically, you have two choices. First one is to write another XSL for InDesign that will allow to import the XML file smoothly within InDesign. Or to not use InDesign at all and have a look at XSL:FO which can convert XML to PDF through XSLT.

Loic
  • 2,173
  • 10
  • 13
  • Ah, XSL:FO, I saw it was mentioned in some articles while researching how best to do the conversion, but I was concentrating on InDesign as I thought it might be the tool to use with minimal coding effort. I hadn't heard of XSL:FO until the other day, so maybe I should read a little more about it. From what you wrote I'm assuming the current XSL can be used, but I would need to write some XSL:FO to actually process the XML & XSL together to produce the PDF. Is that correct? – user5072412 Nov 16 '17 at 09:56
  • Just to be clear. XSL:FO will help turning XML into PDF straightaway outside of InDesign. You can use standard XSL in order to inject XML into inDesign (actually you may even not need it but it's rarely the case). For the latter, it's likely that the XSL file will contain specific instruction (like adding href attributes for pictures, aid:pstyle or aid:cstyle attributes for styles, turning html tables into either CALS or InDesign XML syntax for tables, etc. etc.). So it's up to choose the route you want to walk on. – Loic Nov 16 '17 at 10:43
  • Ok. Hypothetically, if I went the InDesign route (which might be easier for me with my very limited knowledge). Is there any tutorial or guidance that will help me convert the current XSL that I have? – user5072412 Nov 16 '17 at 22:14
  • There isn't any xsl book that I know of which specifically related to InDesign. However, once that said, XSL is pretty transversal. So the main hiccup fir you is understanding how XML works inside InDesign and get your xsl to output a valid xml structure for your layout. – Loic Nov 27 '17 at 15:30