cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Luca Morandini" <luca.morandi...@tin.it>
Subject RE: Greetings, and question
Date Thu, 04 Apr 2002 19:43:39 GMT
Brent,

if you want to process the nodeset enclosed in the <bis> element, you could
just try this:

<xsl:template match="/">
	<xsl:element name="page">
		<xsl:apply-templates/>
	</xsl:element>
</xsl:template>

<xsl:template match="bis">
	<xsl:element name="biselement">
		<xsl:copy-of select="."/>
	</xsl:element>
</xsl:template>

But this is plain XSLT matching, nothing to do with XPATH.

BTW, I've noticed your HTML is NOT XML-compliant, which will cause problems
to XSLT: mind !

Best regards,

---------------------------------------------
               Luca Morandini
               GIS Consultant
              lmorandini@ieee.org
http://utenti.tripod.it/lmorandini/index.html
---------------------------------------------


> -----Original Message-----
> From: Brent Eades [mailto:beades@almonte.com]
> Sent: Thursday, April 04, 2002 8:15 PM
> To: cocoon-users@xml.apache.org
> Subject: Greetings, and question
>
>
> Hello all, just getting up to speed on Cocoon, and finding it all
> quite fascinating. No doubt I'll have many more questions in the
> coming months.
>
> Anyway, today's question is on xpath. I'm trying to customize the
> HTML Generator 'scraper' example to extract bits from a given HTML
> page. Now, I have rudimentary knowledge of xpath syntax, but not
> enough I guess because I'm stuck.
>
> Here's a sample of the HTML to be scraped:
>
> -----------
> <table width="100%" border="0">
> 	<bis t="pr" f="p020326.htm">
> <tr>
> 	<td nowrap align="right" valign="top">
>     26 Mar 2002 &nbsp;
>     </td>
> 	<td valign="top">
>     Financial Stability Forum holds its seventh meeting
>     (<a href="p020326.htm">Read</a>)
>     </td>
> </tr>
> </bis>
>
> <bis t="pr" f="p020318.htm">
> <tr>
> 	<td nowrap align="right" valign="top">
> 	[snip]
>     </td>
> </tr>
> </bis>
>
> Etc.
> ----------
>
> The <bis...> stuff is used by another, non-XML process, but it seemed
> to me it should be a no-brainer to write an xpath argument that would
> pull out between the <bis> </bis> and transform them.
>
> However, it isn't. Can anyone point me in the right general direction
> here?
>
> -----------------------------
> Brent Eades, Almonte, Ontario
>      http://www.almonte.com
>      http://www.bankofcanada.ca
>
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <cocoon-users-unsubscribe@xml.apache.org>
> For additional commands, e-mail: <cocoon-users-help@xml.apache.org>
>


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.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