cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <joerg.heini...@gmx.de>
Subject Re: &amp; in url [WAS: file generator error]
Date Wed, 15 Jan 2003 11:59:33 GMT
Nice to hear that you finally got it to work. Let's end the thread ;-)

Joerg

Sylvain.Thevoz@swisscom.com wrote:
> Hi Joerg,
> 
> Your snippet works well for me (with "&amp;")!
> 
> So, if I'm right this means that it isn't a bug but a problem in my code!?
> 
> => I have found that it was a matcher problem in my sitemap!
> Now it works!
> 
> 
> Thank you all for you help
> Sylvain
> 
> -----Message d'origine-----
> De: Joerg Heinicke [mailto:joerg.heinicke@gmx.de]
> Date: mercredi, 15. janvier 2003 10:47
> À: cocoon-users@xml.apache.org
> Objet: Re: &amp; in url [WAS: file generator error]
> 
> 
> Hi Sylvain,
> 
> yes, we lost the original posting a bit ;-)
> 
> Sylvain.Thevoz@swisscom.com 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.
> 
> Regards,
> 
> Joerg
> 
> 
>>>>-----Message d'origine----- De: Joerg Heinicke
>>>>[mailto:joerg.heinicke@gmx.de]
>>>>
>>>>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="http://www.moreover.com/cgi-local/page?o=xml&amp;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 
>>>>'http://www.moreover.com/cgi-local/page?o=xml&c=Virus%20warnings'
>>>>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 
>>>>'http://www.moreover.com/cgi-local/page?o=xml&c=Virus%20warnings'
>>>> DEBUG   (2003-01-13) 16:48.59:984   [core.manager]
>>>>(/cocoon/joerg/test) Thread-9/SourceResolverImpl: Making URL from
>>>> http://www.moreover.com/cgi-local/page?o=xml&c=Virus%20warnings

-- 

System Development
VIRBUS AG
Fon  +49(0)341-979-7419
Fax  +49(0)341-979-7409
joerg.heinicke@virbus.de
www.virbus.de


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message