Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - Re: XSLT namespace selection (how)? [Thread Next] Re: XSLT namespace selection (how)?To: NULL Date: 6/5/2007 11:28:00 PM * xailor wrote in comp.text.xml: >On Jun 5, 1:43 pm, Joseph Kesselman <keshlam-nos...@comcast.net> >wrote: >> select="opensearch:totalResults" >> select="feed:feed/feed:entry/opensearch:totalResults" > >I just tried this from that XML example in the XSL below but I receive >no selection of the data? Shouldn't the whole openSearch prefix be >prefixed itself? Thanks for all the newbie help. > ><?xml version='1.0'?> ><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' > xmlns:gm='http://base.google.com/ns-metadata/1.0' > xmlns:g='http://base.google.com/ns/1.0' > xmlns:batch='http://schemas.google.com/gdata/batch' > xmlns:feed='http://www.w3.org/2005/Atom' > version="1.0" >> ><xsl:template match="/"> ><div> > <span>total1=<xsl:value-of select="openSearch:totalResults"/> Again, here the context node is the document node which usually has a single child node, the root element of the document, the <feed> element in your example. 'openSearch:totalResults' matches all openSearch: totalResults elements that are a child of the context node, but there is no such child. > <span>total2= <xsl:value-of select="feed:feed/feed:entry/ >openSearch:totalResults"/> </span> This would only match the first openSearch:totalResults element, you likely want this for each entry. -- Björn Höhrmann · mailto:bjoern@h... · http://bjoern.hoehrmann.de Weinh. Str. 22 · Telefon: +49(0)621/4309674 · http://www.bjoernsworld.de 68309 Mannheim · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
