Re: newbie question on p:validate-with-xml-schema

Hi David

The XML declaration is purely a serialization feature. Along with other
serialization options, it can be controlled using the serialization
attributes which can be attached to various XProc elements.

If the XML document in question is the output of your entire pipeline, you
should be able to use the p:serialization element to specify how you want
your pipeline's result port to serialize:

<p:serialization port="result" omit-xml-declaration="false"/>

http://www.w3.org/TR/xproc/#p.serialization

Similarly, if your pipeline is itself responsible for storing the XML, e.g.
using p:store, you can control its serialization directly:

<p:store href="my-result.xml" omit-xml-declaration="false"/>



On 12 January 2016 at 03:23, David Levy <dml.public@sbcglobal.net> wrote:

> Hello,
>
> I have just begun experimenting with Xproc with reasonable success after a
> first day.
>
> I did have one question and I hope I'm not embarrassing myself. When I
> submit an XML document to p:validate-with-xml-schema, the output omits the
> XML prolog:
>
>         <?xml version="1.0" encoding="utf-8"?>
>
> causing some (easily-solved) issues in downstream processing. Or I can just
> pass the input to p:validate-with-xml-schema to downstream steps and ignore
> its output.
>
> But I wonder. Is this intended behavior? Is there an easy way to have
> p:validate-with-xml-schema include the prolog in its output?
>
> With thanks,
>
> David Levy
>
>
>
>


-- 
Conal Tuohy
http://conaltuohy.com/
@conal_tuohy
+61-466-324297

Received on Tuesday, 12 January 2016 02:15:19 UTC