xsl-list
[Top] [All Lists]

Re: XSLT2 variables / nodesets and their namespace

2005-01-21 05:51:17
On Fri, 2005-01-21 at 12:10, David Carlisle wrote:
[...]

You didn't say what your source looked like but perhaps your problem
isn't about generating elements at all but with selecting elements:
one example had
      <xsl:copy-of select="head/*"/>
the other had
      <xsl:copy-of select="f:head/*"/>

the first one selects a head element in no-namespace the second selects
an element head in the xhtml namespace. Which element does your source
file have?

The obvious question! Most of the problems I had were immediately fixed
by setting the source's namespace to the xhtml one. Clearly my brain
wasn't working last night - only succeeded in confusing myself (and
possibly others...)

In XSLT1 you have no alternative but to use prefixes to select
namespaced elements, but in xslt2 you can make teh first unprefixed form
also select an xhtml head if you use the new
xpath-default-namespace="http://www.w3.org/1999/xhtml";
 attribute on xsl:stylesheet

This is what I was missing. It works now :)

Thanks again,
Tom




--~------------------------------------------------------------------
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>