You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@lenya.apache.org by so...@apache.org on 2006/04/07 22:48:21 UTC

Re: xpath

On 4/7/06, Tim wrote:
> first I'd really like to thank you for your website.  Without it i'd be
> nowhere with lenya.  I'm learning a lot from your examples and tutorials.

You are welcome.

> Can you have a quick look at this xpath parameter and tell me what's
> wrong.  I've been able to get the publisher into some xml but, when i
> try to bring in the body of the message to aggregate some files it's not
> working.
> i've deleted what i thought was the irrelevant code.  I'm getting the
> error from my blurbs.xsl file.  If i take out the xhtml namespace i
> don't get an error, but no 'p' either.
> in my blurbs usecase

<map:parameter name="xpath"
value="/*[local-name()='html']/*[local-name()='meta']/*[local-name()='title']|
/*[local-name()='html']/*[local-name()='meta']/*[local-name()='description']|
/*[local-name()='html']/*[local-name()='meta']/*[local-name()='title']|
/*[local-name()='html']/*[local-name()='meta']/*[local-name()='publisher']|
*/*[local-name()='html']/*[local-name()='body']/*[local-name()='p']"/>

Why does the "p" entry start with an asterisk?

You could get the "body", then parse out the "p" in a transformation
later.  Something has to handle the filtering, and it is usually best
to reduce the amount of data as early in the process as possible, but
the data outside the "p" elements may not add much,  you may want that
data later, it would move the processing from the "directory"
generator to a transformer without increasing the CPU cycles much, and
it could simplify your code.

> <xsl:apply-templates select="dir:xpath/xhtml:p"/>
> <xsl:template match="p">
> <p>
>     <xsl:value-of select="."/>
> </p>
> </xsl:template>

That should be:
<xsl:template match="xhtml:p">

solprovider

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@lenya.apache.org
For additional commands, e-mail: user-help@lenya.apache.org