You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Albert Cervera Areny <in...@sedifa.com> on 2003/05/22 17:22:56 UTC

match value substitution in sitemap

I have the following pipe in my sitemap:

<map:match pattern="page-*">
  <map:generate type="request"/>
  <map:transform type="addText">
    <map:parameter name="string" value="{1}"/>
  </map:transform>
  <map:serialize />
</map:match>

addText is a transformer I've made. But I get a couple of errors I can't
understant where they come from.

The first one is that the parameter string is initialized empty instead of
being the * string. Whereas if I use {../ID} (of the sunrise session) the
parameter is well initialized. Plus, I've used the match substitution in
other places in the sitemap and they work correctly (only, the transformer
is xslt).

Another problem is that if I serialize using the XML type, I get the
following error:
XML parsing failed xml processing instruction not at start of external
entity (2:0)

while if I use the standard serializer and check with xmllint the
resulting string it is xml. Has this something to do with namespaces or
the <? ?> declaration? How should I build correct xml code with the
transformer?

Thanks for your suggestions!

Albert.





Albert Cervera Areny
Dept. Informàtica Sedifa, S.L.

Av. Can Bordoll, 149
08202 - Sabadell (Barcelona)
Tel. 93 715 51 11


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org


Re: match value substitution in sitemap

Posted by Albert Cervera Areny <in...@sedifa.com>.
I've found the reason of why it didn't work thanks to log transformer and
I've been able to solve it but without fully understanding it.
The problem was I was sending two startDocument events and two endDocument.
The startDocument one, for example was my fault as I was really sending it
twice (one using super.contentHandler.startDocument and another one using
contentHandler). But my question is, do I have to call the startDocument
function within startDocument? (it's a transformer).

About the endDocument, I've had to remove the only call I was doing and
now only one endDocument results in the logfile generated by the log
transformer, but is the endDocument sent always without me having to throw
it? What do I miss?


> I have the following pipe in my sitemap:
>
> <map:match pattern="page-*">
>   <map:generate type="request"/>
>   <map:transform type="addText">
>     <map:parameter name="string" value="{1}"/>
>   </map:transform>
>   <map:serialize />
> </map:match>
>
> addText is a transformer I've made. But I get a couple of errors I can't
> understant where they come from.
>
> The first one is that the parameter string is initialized empty instead of
> being the * string. Whereas if I use {../ID} (of the sunrise session) the
> parameter is well initialized. Plus, I've used the match substitution in
> other places in the sitemap and they work correctly (only, the transformer
> is xslt).
>
> Another problem is that if I serialize using the XML type, I get the
> following error:
> XML parsing failed xml processing instruction not at start of external
> entity (2:0)
>
> while if I use the standard serializer and check with xmllint the
> resulting string it is xml. Has this something to do with namespaces or
> the <? ?> declaration? How should I build correct xml code with the
> transformer?
>
> Thanks for your suggestions!
>
> Albert.
>
>
>
>
>
> Albert Cervera Areny
> Dept. Informàtica Sedifa, S.L.
>
> Av. Can Bordoll, 149
> 08202 - Sabadell (Barcelona)
> Tel. 93 715 51 11
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
>
>
>


Albert Cervera Areny
Dept. Informàtica Sedifa, S.L.

Av. Can Bordoll, 149
08202 - Sabadell (Barcelona)
Tel. 93 715 51 11


---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-users-help@xml.apache.org