fo:declarations and x:xmpmeta: element not allowed here

Here should go questions about transforming XML with XSLT and FOP.
burnersk
Posts: 1
Joined: Tue Jan 28, 2020 11:24 am

fo:declarations and x:xmpmeta: element not allowed here

Post by burnersk » Tue Jan 28, 2020 11:31 am

When I define PDF meta tags for my XSL-FO transformation, I always receive the following error of the following code snippet.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <!-- ... -->
    <fo:declarations>
        <x:xmpmeta xmlns:x="adobe:ns:meta/">
            <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
                    <dc:title>Title</dc:title>
                    <dc:creator>Author</dc:creator>
                    <dc:description>Subject</dc:description>
                </rdf:Description>
                <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
                    <pdf:Keywords>Keywords</pdf:Keywords>
                </rdf:Description>
                <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
                    <xmp:CreatorTool>Creator</xmp:CreatorTool>
                </rdf:Description>
            </rdf:RDF>
        </x:xmpmeta>
    </fo:declarations>
    <!-- ... -->
</fo:root>
element "x:xmpmeta" not allowed here; expected the element end-tag or element "custom-property", "document-info" or "hyphenation-info" (with xmlns="http://www.antennahouse.com/names/XSL/Extensions")
I could not really find something useful in regard to custom-property or the others.

Can someone help me make my XSL-FO follow strict standards?

Radu
Posts: 7019
Joined: Fri Jul 09, 2004 5:18 pm

Re: fo:declarations and x:xmpmeta: element not allowed here

Post by Radu » Wed Jan 29, 2020 9:38 am

Hi,

Your XSL-FO validation follows the XSL-FO specification and correctly reports the "x:xmpmeta" element as not being part of the standard.
But indeed the Apache FOP PDF processor recognizes various non standard extensions, among which this "x:xmpmeta" element.
Oxygen uses for validation the schemas from the "focheck" open source project:

https://github.com/AntennaHouse/focheck

These schemas recognize Antenna House extensions to the XSL-FO schema but not Apache FOP extensions.
So besides manually making changes to the schemas used by Oxygen for validation (OXYGEN_INSTALL_DIR\frameworks\focheck\schema\rng\axf-mathml3-svg11.rng) I'm not sure what could be done.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply