You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lars Huttar <la...@sil.org> on 2008/09/04 22:24:11 UTC
Re: How to stop validating the XML output
On 7/10/2008 5:20 PM, Leonid Geller wrote:
> Does anyone know if there is an easy way to tell cocoon to stop
> validating the transformed XML output for correctness? E.g. I
> intentionally want to not close some element tags.
>
>
> If possible, I would like to do this for only for some (limited number
> of) pipelines while the others will continue to function with validation
> as before.
>
> For the context, I use Cocoon 2.1.10 with xerces SAX as the default
> parser of choice.
>
> Thanks,
>
>
> -Leonid Geller
>
>
Others have already responded, but I wanted to add some clarifying
background.
When Cocoon pipelines pass XML from one component to another, it's not
in the form of markup (angle brackets and other characters in a long
string). Rather, it's in SAX events, an abstract representation of an
XML tree.
So it's theoretically impossible for a generator or a transformer to
output some start tags and omit the end tags -- they don't output tags
at all. Just SAX events.
It's the serializer's job to translate these SAX events into start tags
and end tags. So as Joerg Heinicke mentioned, you could use an HTML
serializer, which will decide which tags to close based on HTML conventions.
If you really want fine control over the markup of your output, and full
freedom to output malformed XML, you could output text from an XSLT
transformer and then use a text serializer. Then it would all be just a
string of characters, and there would be no XML-related constraints such
as matching start/end tags.
Lars
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org