<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><div>Please read this excellent post on Stackoverflow.</div><div><br></div><div><br></div><div>https://stackoverflow.com/questions/1344158/xslt-with-xml-source-that-has-a-default-namespace-set-to-xmlns</div><div><br></div><div>X4U is not doing anything except processing the results of Saxon transform which is nothing. The namespace is your XML does not match anything in the XSLT.</div><div><br></div><div>Kevin</div><div><br></div><div><br></div><div id="composer_signature"><div style="font-size:85%;color:#575757" dir="auto">Sent from my Verizon, Samsung Galaxy smartphone</div></div><div><br></div><div style="font-size:100%;color:#000000"><!-- originalMessage --><div>-------- Original message --------</div><div>From: Stephen Taylor <stephen@kx.com> </div><div>Date: 5/3/18 1:08 AM (GMT-08:00) </div><div>To: XEP Support <xep-support@renderx.com> </div><div>Subject: [xep-support] Re: line 1: Incorrect top element - should be 'root' </div><div><br></div></div><div dir="ltr">That would be consistent with the following experiment. If I take the XML in its ‘working’ form and change the root element from <font face="monospace, monospace">article</font><font face="arial, helvetica, sans-serif"> to </font><font face="monospace, monospace">book</font><font face="arial, helvetica, sans-serif"> I get the same error message. </font><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">However, using </font><font face="monospace, monospace">xsltproc</font><font face="arial, helvetica, sans-serif"> for the initial XSLT from XML (</font><font face="monospace, monospace">xmlns</font><font face="arial, helvetica, sans-serif"> attribute included) produces valid FO XML:</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><div><font face="monospace, monospace"><?xml version="1.0"?></font></div><div><font face="monospace, monospace"><fo:root xmlns:fo="<a href="http://www.w3.org/1999/XSL/Format" target="_blank">http://www.w3.org/<wbr>1999/XSL/Format</a>" xmlns:xlink="<a href="http://www.w3.org/1999/xlink" target="_blank">http://www.w3.<wbr>org/1999/xlink</a>"><fo:layout-<wbr>master-set><fo:simple-page-<wbr>master master-name="cover-page" page-width="210mm" …</font></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div style=""><span style="font-family:arial,helvetica,sans-serif">which </span><font face="monospace, monospace">x4u</font><font face="arial, helvetica, sans-serif"> renders happily to PDF.</font></div><div style="font-family:arial,helvetica,sans-serif"><br></div><div><span style="font-family:arial,helvetica,sans-serif">That suggests the answer to my question <i>Is there a better solution to this than removing the attribute? </i> might be: Yes, use </span><font face="monospace, monospace">xsltproc</font><font face="arial, helvetica, sans-serif"> for the initial transform to FO. Hard to imagine RenderX being satisfied with this answer, though. </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Let me also draw your attention to the error report from </font><font face="monospace, monospace">x4u</font><font face="arial, helvetica, sans-serif">:</font></div><div><br></div><div><div><font face="monospace, monospace">(document [system-id file:/Users/sjt/Projects/kx/<wbr>tmp/aws/aws.xml]</font></div><div><font face="monospace, monospace"> (validate </font></div><div><font face="monospace, monospace"> [error] file:/Users/sjt/Projects/kx/<wbr>tmp/aws/aws.xml: line 1: Incorrect top element - should be 'root'</font></div><div><font face="monospace, monospace"> [validation total: 1 error]</font></div><div><font face="monospace, monospace"> [error] com.renderx.xep.lib.<wbr>FormatterException: Invalid XSL FO source 'file:/Users/sjt/Projects/kx/<wbr>tmp/aws/aws.xml': 1 error found during validation</font></div><div><font face="monospace, monospace"> [error] javax.xml.transform.<wbr>TransformerException: com.renderx.xep.lib.<wbr>FormatterException: Invalid XSL FO source 'file:/Users/sjt/Projects/kx/<wbr>tmp/aws/aws.xml': 1 error found during validation</font></div><div><font face="monospace, monospace"> [error] formatting failed</font></div><div><font face="monospace, monospace"> [error] javax.xml.transform.<wbr>TransformerException: com.renderx.xep.lib.<wbr>FormatterException: Invalid XSL FO source 'file:/Users/sjt/Projects/kx/<wbr>tmp/aws/aws.xml': 1 error found during validation</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Formatting failed</font></div><div style="font-family:arial,helvetica,sans-serif"><br></div></div><div><font face="arial, helvetica, sans-serif">We suppose the error to be in the FO produced by the initial transform. Above it is reported helpfully as </font><font face="monospace, monospace">Invalid XSL FO source</font><font face="arial, helvetica, sans-serif"> but misleadingly as a validation error in line 1 of the original XML source. </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">That would of course be the place to point if no stylesheet were being applied. But </font><font face="monospace, monospace">x4u</font><font face="arial, helvetica, sans-serif"> knows better.</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">What would I want </font><font face="monospace, monospace">x4u</font><font face="arial, helvetica, sans-serif"> to do here? Write the intermediate FO to a temporary file and report the validation error in that. In this case the error seems to be in XEP’s XSLT processor, but if my XSL had produced invalid FO it would be helpful to see it. </font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Which leaves questions:</font><div><ol><li><font face="arial, helvetica, sans-serif">Why does </font><font face="monospace, monospace">x4u</font><font face="arial, helvetica, sans-serif"> choke on the </font><font face="monospace, monospace">xmlns</font><font face="arial, helvetica, sans-serif"> attribute?</font></li><li><font face="arial, helvetica, sans-serif">Is there a better solution than (a) removing the attribute or (b) avoiding the XEP XSLT processor for the transformation to FO?</font></li></ol><div class="gmail_extra">Stephen<br clear="all"><div><div class="m_5027261148427409900gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><font face="verdana, sans-serif" size="1"><br></font><div><font face="verdana, sans-serif" size="1"><br></font></div><div><font face="verdana, sans-serif" size="1">Stephen Taylor | Librarian | <b><font color="#3d85c6">Kx</font></b> | +44 7713 400852 | <a href="mailto:stephen@kx.com" target="_blank">stephen@kx.com</a></font></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On 2 May 2018 at 20:00, <span dir="ltr"><<a href="mailto:xep-support-request@renderx.com" target="_blank">xep-support-request@renderx.<wbr>com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send Xep-support mailing list submissions to<br>
<a href="mailto:xep-support@renderx.com" target="_blank">xep-support@renderx.com</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="http://lists.renderx.com/mailman/listinfo/xep-support" rel="noreferrer" target="_blank">http://lists.renderx.com/mailm<wbr>an/listinfo/xep-support</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:xep-support-request@renderx.com" target="_blank">xep-support-request@renderx.co<wbr>m</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:xep-support-owner@renderx.com" target="_blank">xep-support-owner@renderx.com</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Xep-support digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. Re: Xep-support Digest, Vol 86, Issue 1 (Kevin Brown)<br>
<br>
<br>
------------------------------<wbr>------------------------------<wbr>----------<br>
<br>
Message: 1<br>
Date: Tue, 1 May 2018 14:44:21 -0700<br>
From: "Kevin Brown" <<a href="mailto:kevin@renderx.com" target="_blank">kevin@renderx.com</a>><br>
To: "'RenderX Community Support List'" <<a href="mailto:xep-support@renderx.com" target="_blank">xep-support@renderx.com</a>><br>
Subject: [xep-support] Re: Xep-support Digest, Vol 86, Issue 1<br>
Message-ID: <001801d3e195$92c447b0$b84cd71<wbr>0$@<a href="http://renderx.com" rel="noreferrer" target="_blank">renderx.com</a>><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
In other words:<br>
<br>
<br>
<br>
<article xmlns=?<a href="http://docbook.org/ns/docbook" rel="noreferrer" target="_blank">http://docbook.org/ns/d<wbr>ocbook</a>?><br>
<br>
<br>
<br>
Does not match:<br>
<br>
<article><br>
<br>
<br>
<br>
Kevin<br>
<br>
<br>
<br>
From: Xep-support [mailto:<a href="mailto:xep-support-bounces@renderx.com" target="_blank">xep-support-bounces@re<wbr>nderx.com</a>] On Behalf Of Stephen Taylor<br>
Sent: Tuesday, May 01, 2018 2:14 PM<br>
To: XEP Support <<a href="mailto:xep-support@renderx.com" target="_blank">xep-support@renderx.com</a>><br>
Subject: [xep-support] Re: Xep-support Digest, Vol 86, Issue 1<br>
<br>
<br>
<br>
Sorry I did not make myself more clear. <br>
<br>
<br>
<br>
x4u renders my XML and XSL as a PDF ? 70 pages of beautiful typography ? provided I remove the xmlns attribute from the XML root element, which is, as you note, article. <br>
<br>
<br>
<br>
The xmlns attribute was written by Pandoc <<a href="http://pandoc.org" rel="noreferrer" target="_blank">http://pandoc.org</a>> as DocBook 5 <<a href="http://docbook.org" rel="noreferrer" target="_blank">http://docbook.org</a>> XML output. It looks correct to me. DocBook is an XML application that will be familiar to many XEP users. So I?m wondering why x4u would report the attribute as a validation error in the XML. <br>
<br>
<br>
<br>
My question stands: is there a better solution to this than removing the attribute? <br></blockquote></div></div></div></div></div></div>
</body></html>