Embedding DocBook → PDF transformation in a Jav a web app
Paul Hoadley <[email protected]> Fri, 28 Jul 2023 13:35:33 +0930
| Newsgroups | gmane.text.docbook.apps |
|---|---|
| Message-ID | <[email protected]> |
--Apple-Mail=_BA0FBBB9-5C8E-467B-8D7E-A140C056ADE6 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hello, I'm at the proof-of-concept phase of building some DocBook =E2=86=92 PDF = transformation into a web application. Our requirements are quite = modest, and I've built a customisation layer over the 1.79.2 stylesheets = for the moment, though could happily use the xslt20 stylesheets if more = appropriate. What I want to do, at least in the first instance, is run this entirely = within the web app's JVM=E2=80=94that is, no calling out to external = tools or services. Additionally, I want the stylesheets and = customisations to live in a JAR, not on any local filesystem. As a quick = and dirty test, I've put the custom stylesheets in = src/main/resources/xsl, and then the entire docbook-xsl-1.79.2 directory = in there as well. I'm just using JUnit 5 (in Eclipse) to run some test = code against this idea. Using Saxon HE-12.3, I can't get any further = than loading the top-level customisation stylesheet (by getting an = InputStream from getResourceAsStream() and wrapping that in a = StreamSource). Trying to import anything else results in a range of = failure modes. I can be more specific about what I've tried, and how it fails, but = obviously this isn't a Java mailing list. For now, can anyone (a) tell = me whether this is likely to succeed, or whether there's a better = approach, or (b) even better, point me at an example of this working in = the wild? --=20 Paul Hoadley https://logicsquad.net/ https://www.linkedin.com/company/logic-squad/ --Apple-Mail=_BA0FBBB9-5C8E-467B-8D7E-A140C056ADE6 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; line-break: after-white-space;" = class=3D"">Hello,<div class=3D""><br class=3D""></div><div class=3D"">I'm = at the proof-of-concept phase of building some DocBook =E2=86=92 = PDF transformation into a web application. Our requirements are quite = modest, and I've built a customisation layer over the 1.79.2 stylesheets = for the moment, though could happily use the xslt20 stylesheets if more = appropriate.</div><div class=3D""><br class=3D""></div><div = class=3D"">What I want to do, at least in the first instance, is run = this entirely within the web app's JVM=E2=80=94that is, no calling out = to external tools or services. Additionally, I want the stylesheets and = customisations to live in a JAR, not on any local filesystem. As a quick = and dirty test, I've put the custom stylesheets in = src/main/resources/xsl, and then the entire docbook-xsl-1.79.2 directory = in there as well. I'm just using JUnit 5 (in Eclipse) to run some test = code against this idea. Using Saxon HE-12.3, I can't get any further = than loading the top-level customisation stylesheet (by getting an = InputStream from getResourceAsStream() and wrapping that in a = StreamSource). Trying to import anything else results in a range of = failure modes.</div><div class=3D""><br class=3D""></div><div class=3D"">I= can be more specific about what I've tried, and how it fails, but = obviously this isn't a Java mailing list. For now, can anyone (a) tell = me whether this is likely to succeed, or whether there's a better = approach, or (b) even better, point me at an example of this working in = the wild?</div><div class=3D""><br class=3D""></div><div class=3D""><br = class=3D""><div class=3D""> <div style=3D"color: rgb(0, 0, 0); letter-spacing: normal; text-align: = start; text-indent: 0px; text-transform: none; white-space: normal; = word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: = break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" = class=3D""><div style=3D"color: rgb(0, 0, 0); letter-spacing: normal; = text-align: start; text-indent: 0px; text-transform: none; white-space: = normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: = break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" = class=3D""><span class=3D"Apple-style-span" style=3D"border-collapse: = separate; color: rgb(0, 0, 0); font-family: "Lucida Grande"; = font-style: normal; font-variant-ligatures: normal; = font-variant-position: normal; font-variant-caps: normal; = font-variant-numeric: normal; font-variant-alternates: normal; = font-variant-east-asian: normal; font-weight: normal; letter-spacing: = normal; line-height: normal; orphans: 2; text-align: -webkit-auto; = text-indent: 0px; text-transform: none; white-space: normal; widows: 2; = word-spacing: 0px; border-spacing: 0px; = -webkit-text-decorations-in-effect: none; -webkit-text-stroke-width: = 0px;"><div style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; = line-break: after-white-space;" class=3D"">-- <br class=3D"">Paul = Hoadley<br class=3D""><a href=3D"https://logicsquad.net/" = class=3D"">https://logicsquad.net/</a><br = class=3D"">https://www.linkedin.com/company/logic-squad/</div><div = style=3D"word-wrap: break-word; -webkit-nbsp-mode: space; line-break: = after-white-space;" class=3D""><br = class=3D""></div></span></div></div></div></div></body></html>= --Apple-Mail=_BA0FBBB9-5C8E-467B-8D7E-A140C056ADE6--