cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: &amp; in url [WAS: file generator error]
Date Wed, 15 Jan 2003 09:46:55 GMT
Hi Sylvain,

yes, we lost the original posting a bit ;-) wrote:
> Joerg,
> I found the same as you if I type the URL in my browser.

Nice to hear.

> But in my case the problem is that the URL will be parsed through an
> XML parser.
> If I type "&" the XML parser returns me this error: An error occurred
>  The org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode
> notifies that org.apache.cocoon.ProcessingException says: The
> reference to entity "c" must end with the ';' delimiter.
> More precisely: org.apache.cocoon.ProcessingException: Failed to load
> sitemap from
> file:/C:/jakarta-tomcat-4.1.12/webapps/cocoon/woc/portal-fw/sitemap.xmap:
> file:/C:/jakarta-tomcat-4.1.12/webapps/cocoon/woc/portal-fw/sitemap.xmap:168:70:org.xml.sax.SAXParseException:
> The reference to entity "c" must end with the ';' delimiter.

That's clear, it must be so. & means "here starts an entity". And in 
contrast to most HTML browsers an XML parser doesn't try to add the 
obviously missing ';'.

> And If I type "&amp;" the XML parser doesn't return an error but the
> link isn't correct anymore because it uses "&amp;" instead of "&".

And here you are wrong. The link *is* correct then. Similar to HTML 
(e.g. <a href=""/>) you *must* escape & to &amp; (HTML browsers only try 
to solve the problem themselves, if they find an & without ;). And as 
you can see below in the quoted message I had it working (&amp; is 
resolved to &). Try to add this little snippet into the sitemap (only 
map:generate + map:serialize), test it, have a look into the core.log 
and tell me, what's wrong with your Cocoon version. Maybe you test a 
newer one, if there was really a bug in the resolving, but I don't 
assume so.



>>> -----Message d'origine----- De: Joerg Heinicke
>>> []
>>> Hello Geoff and Sylvain,
>>> I can't confirm a bug using Cocoon 2.1 dev from CVS (2003-01-07).
>>> Using this sitemap snippet
>>> <map:match pattern="test"> <map:generate 
>>> src=";c=Virus%20wa
>>>  rnings"/> <map:serialize type="xml"/> </map:match>
>>> DEBUG   (2003-01-13) 16:48.59:984   [core.manager]
>>> (/cocoon/joerg/test) Thread-9/SourceResolverImpl: Resolving 
>>> ''
>>> with base 'file:/D:/xml/' in context 'file:/D:/Tomcat/bin/'
>>> DEBUG (2003-01-13) 16:48.59:984   [core.manager]
>>>(/cocoon/joerg/test) Thread-9/SourceResolverImpl: Resolved to systemID 
>>> ''
>>>  DEBUG   (2003-01-13) 16:48.59:984   [core.manager]
>>> (/cocoon/joerg/test) Thread-9/SourceResolverImpl: Making URL from

Please check that your question  has not already been answered in the
FAQ before posting.     <>

To unsubscribe, e-mail:     <>
For additional commands, e-mail:   <>

View raw message