tags:

views:

30

answers:

1

For example, I'm trying to pick out the value "Application Library" from the following XML - ie, the value under content-node/localedata/title, where localedata@locale = "en".

<content-node objectid="6_NO2UF4I1186E1026H4BLVI08F1">
       <localedata locale="de">
            <title>Anwendungsbibliothek</title>
        </localedata>
        <localedata locale="en">
            <title>Application Library</title>
        </localedata>
        <localedata locale="es">
            <title>Biblioteca de aplicaciones</title>
        </localedata>
</content-node>

Specifically, what XPath expression do I put in the xsl:template@match value? I think it should be something like this, except I don't know how to match for the hardcoded value "en":

<xsl:template match="localedata[@locale = en]">

Am I on the right track here, or is there some other way I should go about this?

+2  A: 

I would say yes, you should be on the right track. I can't seem to find any samples to verify and confirm this - but you should have no trouble trying and verifying this.

I say : go for it!

Looks like you'll have to adapt your XSL just a tiny bit:

<xsl:template match="localedata[@locale='en']">

With this (remove spaces after @locale, put the value in ' ... ') everything should be fine.

Marc

marc_s
Thanks. That formatting worked.... I hadn't been able to find a demonstrative example of it either.
Spike Williams