Store non-well-formed HTML fragment

Dear all,
is there any way to serialize non-well-formed HTML using p:store? Particularly, I'm trying to store an HTML fragment that does not have a single root node. While this works with plain XSL result-documents, XProc fails with the following error:

"XD0001 : XD0001 It is a dynamic error if a non-XML resource is produced on a step output or arrives on a step input."

This is the full pipeline:

<?xml version="1.0" encoding="UTF-8"?>
<p:declare-step xmlns:p="http://www.w3.org/ns/xproc" xmlns:c="http://www.w3.org/ns/xproc-step" version="1.0">
    <p:input port="source">
        <p:empty/>
    </p:input>
    <p:output port="result">
        <p:pipe port="result" step="store"/>
    </p:output>
    <p:xslt name="xsl">
        <p:input port="source">
            <p:inline>
                <test/>
            </p:inline>
        </p:input>
        <p:input port="parameters">
            <p:empty/>
        </p:input>
        <p:input port="stylesheet">
            <p:inline>
                <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0">
                    <xsl:template match="/">
                        <xsl:result-document href="test.snippet.xml" indent="yes" omit-xml-declaration="yes" method="xml" exclude-result-prefixes="#all">
                            <div>
                                Test
                            </div>
                            <p>
                                Test
                            </p>
                        </xsl:result-document>
                    </xsl:template>
                </xsl:stylesheet>
            </p:inline>
        </p:input>
    </p:xslt>
    <p:sink>
        <p:input port="source">
            <p:pipe port="result" step="xsl"/>
        </p:input>
    </p:sink>
    <p:store name="store" href="test.html">
        <p:input port="source">
            <p:pipe port="secondary" step="xsl"/>
        </p:input>
    </p:store>
</p:declare-step>

Any help is appreciated.
Cheers,

Vivian

Received on Sunday, 2 June 2013 17:20:44 UTC