xsl-list
[Top] [All Lists]

[xsl] XSLT 1.0 Namespace Help

2014-08-25 09:17:55
Hi all,

I'm trying to reference the following XML document:

    <?xml version="1.0" encoding="UTF-8"?>
    <sparql xmlns="http://www.w3.org/2001/sw/DataAccess/rf1/result";>
    <head>
        <variable name="collection"/>
    </head>
    <results>
        <result>
            <collection uri="info:fedora/islandora:root"/>
        </result>
        <result>
            <collection uri="info:fedora/digital:collections"/>
        </result>
        <result>
            <collection uri="info:fedora/collections:gsmrc"/>
        </result>
        <result>
            <collection uri="info:fedora/gsmrc:webster"/>
        </result>
    </results>
    </sparql>

in a variable:

    <xsl:variable name="queryDoc" select="document('example.xml')"/>

Later in my stylesheet, I'm trying to get at the `@uri` values with the
following:

    <xsl:for-each select="$queryDoc//collection/@uri">
        <filterName>
            <xsl:value-of select="."/>
        </filterName>
    </xsl:for-each>

But I'm having problems getting to that value. When I look at the XPath in
oXygen, the path to @uri is
/default:sparql/default:results/default:result/default:collection/@uri but
using that isn't working, either. So, I either have a syntax error in my
XPath or I'm just plain doing it wrong.

Am I overlooking something in that expression?
Thank you for your time and trouble.

Best,
Bridger
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--
<Prev in Thread] Current Thread [Next in Thread>