[xep-support] Re: line 1: Incorrect top element - should be 'root'

From: Stephen Taylor <stephen_at_ADDRESS_REMOVED>
Date: Thu May 03 2018 - 01:08:07 PDT

That would be consistent with the following experiment. If I take the XML
in its ‘working’ form and change the root element from article to book I
get the same error message.

However, using xsltproc for the initial XSLT from XML (xmlns attribute
included) produces valid FO XML:

<?xml version="1.0"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xlink="
http://www.w3.org/1999/xlink"><fo:layout-master-set><fo:simple-page-master
master-name="cover-page" page-width="210mm" …

which x4u renders happily to PDF.

That suggests the answer to my question *Is there a better solution to this
than removing the attribute? * might be: Yes, use xsltproc for the initial
transform to FO. Hard to imagine RenderX being satisfied with this answer,
though.

Let me also draw your attention to the error report from x4u:

(document [system-id file:/Users/sjt/Projects/kx/tmp/aws/aws.xml]
  (validate
    [error] file:/Users/sjt/Projects/kx/tmp/aws/aws.xml: line 1: Incorrect
top element - should be 'root'
    [validation total: 1 error]
    [error] com.renderx.xep.lib.FormatterException: Invalid XSL FO source
'file:/Users/sjt/Projects/kx/tmp/aws/aws.xml': 1 error found during
validation
    [error] javax.xml.transform.TransformerException:
com.renderx.xep.lib.FormatterException:
Invalid XSL FO source 'file:/Users/sjt/Projects/kx/tmp/aws/aws.xml': 1
error found during validation
    [error] formatting failed
    [error] javax.xml.transform.TransformerException:
com.renderx.xep.lib.FormatterException:
Invalid XSL FO source 'file:/Users/sjt/Projects/kx/tmp/aws/aws.xml': 1
error found during validation

Formatting failed

We suppose the error to be in the FO produced by the initial transform.
Above it is reported helpfully as Invalid XSL FO source but misleadingly as
a validation error in line 1 of the original XML source.

That would of course be the place to point if no stylesheet were being
applied. But x4u knows better.

What would I want x4u 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.

Which leaves questions:

   1. Why does x4u choke on the xmlns attribute?
   2. Is there a better solution than (a) removing the attribute or (b)
   avoiding the XEP XSLT processor for the transformation to FO?

Stephen

Stephen Taylor | Librarian | *Kx* | +44 7713 400852 | stephen@kx.com

On 2 May 2018 at 20:00, <xep-support-request@renderx.com> wrote:

> Send Xep-support mailing list submissions to
> xep-support@renderx.com
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.renderx.com/mailman/listinfo/xep-support
> or, via email, send a message with subject or body 'help' to
> xep-support-request@renderx.com
>
> You can reach the person managing the list at
> xep-support-owner@renderx.com
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Xep-support digest..."
>
>
> Today's Topics:
>
> 1. Re: Xep-support Digest, Vol 86, Issue 1 (Kevin Brown)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 1 May 2018 14:44:21 -0700
> From: "Kevin Brown" <kevin@renderx.com>
> To: "'RenderX Community Support List'" <xep-support@renderx.com>
> Subject: [xep-support] Re: Xep-support Digest, Vol 86, Issue 1
> Message-ID: <001801d3e195$92c447b0$b84cd710$@renderx.com>
> Content-Type: text/plain; charset="utf-8"
>
> In other words:
>
>
>
> <article xmlns=?http://docbook.org/ns/docbook?>
>
>
>
> Does not match:
>
> <article>
>
>
>
> Kevin
>
>
>
> From: Xep-support [mailto:xep-support-bounces@renderx.com] On Behalf Of
> Stephen Taylor
> Sent: Tuesday, May 01, 2018 2:14 PM
> To: XEP Support <xep-support@renderx.com>
> Subject: [xep-support] Re: Xep-support Digest, Vol 86, Issue 1
>
>
>
> Sorry I did not make myself more clear.
>
>
>
> 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.
>
>
>
> The xmlns attribute was written by Pandoc <http://pandoc.org> as DocBook
> 5 <http://docbook.org> 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.
>
>
>
> My question stands: is there a better solution to this than removing the
> attribute?
>

_______________________________________________
(*) To unsubscribe, please visit http://lists.renderx.com/mailman/options/xep-support
(*) By using the Service, you expressly agree to these Terms of Service http://w
ww.renderx.com/terms-of-service.html
Received on Thu May 3 01:07:03 2018

This archive was generated by hypermail 2.1.8 : Thu May 03 2018 - 01:07:17 PDT