FHIR Chat · IG Publisher pre-processing · implementers

Stream: implementers

Topic: IG Publisher pre-processing


view this post on Zulip Stephen Royce (Aug 07 2017 at 02:56):

I have 2 questions regarding pre-processing in the IG Publisher:

  • If one has access to Saxon, is there anyway to swap out the Apache-derived (I presume) XSL engine with Saxon so that one could use XSL 2.0?
  • If I use pre-processing to create UML SVG, can I use the name format that the publisher uses, i.e. [type]-[id]-uml.xhtml, or will these get wiped out by the IG Publisher and so I should some other file name construct?

view this post on Zulip Grahame Grieve (Aug 07 2017 at 03:01):

first: we hate saxon because of it's weird deployment issues

view this post on Zulip Grahame Grieve (Aug 07 2017 at 03:02):

that's not a no, but I'm just not interested in supporting saxon for the IG publisher unless someone funds it

view this post on Zulip Grahame Grieve (Aug 07 2017 at 03:02):

I don't know about the names

view this post on Zulip Grahame Grieve (Aug 07 2017 at 03:02):

you'd have to try

view this post on Zulip Stephen Royce (Aug 07 2017 at 03:12):

Thanks.

view this post on Zulip Stephen Royce (Aug 07 2017 at 03:12):

One more thing: what's the actual input to the pre-process XSL?

view this post on Zulip Grahame Grieve (Aug 07 2017 at 03:45):

you'll have to askLloyd

view this post on Zulip Grahame Grieve (Aug 07 2017 at 03:45):

@Lloyd McKenzie - question for you

view this post on Zulip Lloyd McKenzie (Aug 07 2017 at 04:31):

The input is the XHTML page files. You can use the transform to assign section headings and the like. I'll send you the one I use.

view this post on Zulip Stephen Royce (Aug 07 2017 at 07:02):

Thanks @Lloyd McKenzie . :simple_smile:
Should I expect to have seen something in my e-mail inbox?

view this post on Zulip Stephen Royce (Aug 07 2017 at 07:23):

I assume that input means you don't have direct access to the actual StructureDefinition XML.

view this post on Zulip Lloyd McKenzie (Aug 07 2017 at 20:56):

You should - if you didn't, then I must have the wrong one. Can you PM me the correct one?

view this post on Zulip Stephen Royce (Sep 05 2017 at 06:40):

Okay, so I _finally_ got around to trying some stuff out here, but I'm confused about a few things. In particular, right now, what do you put in the JSON control file for pre-processing? I put the name of my XSL file in the pre-process.transform, but then it complained about not having a value for pre-process.folder. Is this folder the output directory or the input directory? I assume it's the former, so if I want just a trivial, pass-through result, should I set the value to "output" or perhaps "pages"?

Also, I noticed I got an error in the net.sf.saxon namespace when I used "temp" as the value for pre-process.folder. Does this mean that Saxon is available? Or is it ancient Saxon (v6.5.5) and so XSLT2 is still not an option?

view this post on Zulip Lloyd McKenzie (Sep 05 2017 at 13:49):

pre-process.folder is the folder to grab from. pre-process.relativePath is the folder to put the output in (relative to 'temp'). To the best of my knowledge, we can't use XSLT2. Grahame was pretty firm :)

view this post on Zulip Stephen Royce (Sep 06 2017 at 03:03):

Thanks. So what folder should I be grabbing from? temp?

view this post on Zulip Lloyd McKenzie (Sep 06 2017 at 05:00):

Whatever folder contains the files you want to pre-process

view this post on Zulip Stephen Royce (Sep 06 2017 at 08:08):

How do I find which files are where?
(The ones I'm looking for are the StructureDefinition HTML files which seem to be in temp, and the profile/extension lists, which I would have thought would be in temp/_includes but I can't find and which I expect will be difficult to pre-process anyway because they're not well-formed.)

view this post on Zulip Grahame Grieve (Sep 06 2017 at 08:11):

the files in temp don't exist when pre-processing happens - that's why it's called 'pre-processing'

view this post on Zulip Lloyd McKenzie (Sep 06 2017 at 13:16):

Pre-processing lets you take source and do something with it before it's used as source for the publication process. For example, I use pre-process to assign section numbers to my pages and mini table-of-contents for the page.

view this post on Zulip Lloyd McKenzie (Sep 06 2017 at 13:17):

The publisher then uses the transformed files as source for my pages.

view this post on Zulip Stephen Royce (Sep 07 2017 at 06:38):

@Lloyd McKenzie When you say "source", what exactly do you mean? Is it your own content? If so, what's the point; can't you just include the section numbers in the source at creation? If not, then where is it coming from. I looked at your XSL and I can see what it's doing, but if the HTML source is not the generated content from the IG Publisher, what is it?
BTW, I had thought the "pre" in "pre-processing" meant before Jekyll, not before content creation.

view this post on Zulip Stephen Royce (Sep 07 2017 at 06:40):

So here's my problem: I want to add some Bootstrap classes to some of the HTML content generated by the IG Publisher, but before it's assembled by Jekyll. Can I use pre-processing to do this, or do I have to write my own post-processor. (I really hope not, because post-processing would amount to screen scraping, and that's really nasty!)

view this post on Zulip Lloyd McKenzie (Sep 07 2017 at 13:13):

I could include the section numbers in the source at creation, but it's a huge pain and chances of getting them right is slim. Having it done automatically is much easier. The transform step doesn't touch the generated HTML - I have no need to do that. It's to pre-process the various ad-hoc descriptive pages and supporting content. There's presently no way to change the HTML fragments produced by the IG-publisher except by editing the IG-publisher's java code. You can certainly submit a change request asking for what you'd like. If it would have general utility, we'd probably make the change. Or if we could make a transparent change that would allow you to use CSS to drive the desired behavior, that could work too.

view this post on Zulip Eric Haas (Sep 07 2017 at 18:24):

There is a resource variable index for each structuredefinition which is shown here which you can use in the templates to creates section numbers.

view this post on Zulip Stephen Royce (Sep 08 2017 at 00:33):

Blast!
But maybe there's a silver lining: does this mean that I can use pre-processing on the items in the resources directory to do things like create my own UML SVG fragments?

view this post on Zulip Grahame Grieve (Sep 08 2017 at 03:01):

yes that you can do

view this post on Zulip Parijat Kar (Sep 10 2017 at 16:37):

How to use HAPI FHIR APIs: http://hapifhir.io/doc_rest_client.html

view this post on Zulip Parijat Kar (Sep 10 2017 at 16:38):

Server used: http://fhirtest.uhn.ca/baseDstu3


Last updated: Apr 12 2022 at 19:14 UTC