xsl-list
[Top] [All Lists]

[xsl] Select Parent when child exists

2007-11-27 02:15:02
Hi,

I'm trying to select all the parents that have a child node matching a
certain value. It's basically transforming a blog RSS feed and I only want
to select those posts that have a specific tag.

The feed looks like this:
<feed>
        <post>
                <title>Title of the post 1</title>
                <tags>
                        <tag>example</tag>
                </tags> 
        </post>
        <post>
                <title>Title of the post 2</title>
                <tags>
                        <tag>example2</tag>
                </tags> 
        </post>
        <post>
                <title>Title of the post 3</title>
                <tags>
                        <tag>example</tag>
                        <tag>example3</tag>
                </tags> 
        </post>
</feed>

In this example I want posts 1 and 3.

I've had a Google around but I've not found any definitive answer. I was
thinking of an if statement but I would like to look the latest x posts and
I'm not sure how I can do that using an if statement as postion() is
incremental regardless of the quantifier.

TIA

Tim


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--

<Prev in Thread] Current Thread [Next in Thread>