You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Harald Wehr <hw...@hs-harz.de> on 2003/03/11 12:06:07 UTC

HTML-Generator - XPath

Hi,

yesterday we upated our webapp with the current changes of cocoon-2.1 
repository. I have a question concerning the HTML-Generator. The 
following sitemap-snippet matched in our previous version the body-tag 
of the google-site. This is not working anymore. Are there any changes 
concerning the xpath-expression?

<map:match pattern="**/google.html">
	<map:generate type="html" src="http://www.google.de">
         	<map:parameter name="xpath" value="//body"/>
	</map:generate>
	<map:serialize/>
</map:match>

In the meantime we made a dirty solution by changing the 
xpath-expression to: "//*[contains(name(),'body')]".
This is working but we are looking for a better solution where we can 
use our previous statements. Any hints here?

Thanks
Harald




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


Re: HTML-Generator - XPath

Posted by Harald Wehr <hw...@hs-harz.de>.
Hi Tony

> 
> I've had problems with Google, mainly because they forbid fetching and
> searching their page using programs (The "Java" useragent is banned from
> their server).  If you're wanting to use Cocoon and Google search, you
> might want to look into their SOAP API.

Thats not a problem. We changed the default HTMLGenerator to read the 
parameters as well as the header information from the incoming requests. 
So Google would see the browser agent of the actual request that is 
coming into Cocoon.

No one else with some xpath-problems in the HTMLGenerator?

Thanks Harald



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


Re: HTML-Generator - XPath

Posted by Tony Collen <tc...@neuagency.com>.
On Tue, 11 Mar 2003, Harald Wehr wrote:

> Hi,
>
> yesterday we upated our webapp with the current changes of cocoon-2.1
> repository. I have a question concerning the HTML-Generator. The
> following sitemap-snippet matched in our previous version the body-tag
> of the google-site. This is not working anymore. Are there any changes
> concerning the xpath-expression?

Not directly that I know of, but I have run into problems with some sites
where I have to give the xpath index in the file, i.e.
/html/body/div[1]/table[1]/tr[1]/td[1]  etc which is very tedious.  I
haven't found a way around it.  the HTMLGenerator's xpath *does* seem a
lot more picky compared to when I first started using Cocoon.

> 	<map:generate type="html" src="http://www.google.de">

I've had problems with Google, mainly because they forbid fetching and
searching their page using programs (The "Java" useragent is banned from
their server).  If you're wanting to use Cocoon and Google search, you
might want to look into their SOAP API.

Regards,

Tony


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