Forum How do I...?

Did --input=xml behavior change for --xinclude from Prince 12.5 to Prince 13.1?

jaredculp
Using input:
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="/tmp/include.html"></xi:include>
</html>


Running against Prince 12.5 this worked fine. Command:
~ $ prince --version
Prince 12.5
Copyright 2002-2019 YesLogic Pty. Ltd.
CSO License
~ $ cat input.html | /usr/local/bin/prince --input=xml --no-subset-fonts --structured-log=buffered --no-system-fonts --xinclude --style=/tmp/font_cache/fontcache5707278573557654795/Arial.ttf4837291807626154676.style --force-identity-encoding --css-dpi=72 - > output.pdf
fin|success


Against Prince 13.1, using the existing command, we see a failure:
~ $ prince --version
Prince 13.1
Copyright 2002-2019 YesLogic Pty. Ltd.
CSO License
~ $ cat input.html | /usr/local/bin/prince --input=xml --no-subset-fonts --structured-log=buffered --no-system-fonts --xinclude --style=/tmp/font_cache/fontcache5707278573557654795/Arial.ttf4837291807626154676.style --force-identity-encoding --css-dpi=72 - > output.pdf
msg|err|/tmp/include.html|not loading standard input
msg|wrn||failed to load "/tmp/include.html"
msg|err|-:3|could not load /tmp/include.html, and no fallback was found
fin|success


We are upgrading to this version of prince in order to get support for "Support for SVG gradient spreadMethod repeat and reflect using PostScript function based shading."
jaredculp
I should note that line 3 of input.html (that's how I'm interpreting the last error message) contains:

  <xi:include href="/tmp/include.html"></xi:include>

Edited by jaredculp

jaredculp
I tried changing:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xi="http://www.w3.org/2001/XInclude">


to

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xi="http://www.w3.org/2001/XInclude"
      xsi:schemaLocation="http://www.w3.org/2001/XInclude http://www.w3.org/2001/XInclude.xsd">


but that didn't work.

Edited by jaredculp

dauwhe
I got your original input to work with a simple HTML include and Prince 13.1:

prince --input=xml --xinclude ~/Desktop/include.xml


So I think namespaces etc are OK...
mikeday
This is a bug in Prince 13 affecting XInclude and external entities in documents read from standard input, we will fix it shortly.
jaredculp
Thanks mikeday. Any idea on the timeframe for when that fix version will be available? Are there any potential workarounds in the meantime?

Edited by jaredculp

mikeday
I think the only short term workaround is to read the input document from a temporary file instead of stdin, sorry for the inconvenience.
jaredculp
Got it. Do you know when the next prince release will be?
jaredculp
It looks like this issue isn't present in Prince 13.0 (can you confirm?) so we may use that for now.
mikeday
Yes this issue was introduced in Prince 13.1 as an unwanted side effect of fixing an issue with loading XML documents from Windows UNC paths. We will release Prince 13.2 as soon as convenient, hopefully next week.
mikeday
Prince 13.2 is available now and includes a fix, thanks for letting us know about the issue! :D