[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: namespace problem

Subject: Re: namespace problem
From: "Ruud Grosmann r.grosmann@xxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 Sep 2014 08:26:49 -0000
Re:  namespace problem
On 09/11/14 14:50, Wendell Piez wapiez@xxxxxxxxxxxxxxx wrote:
As to your question (how to match in the xhtml namespace only), one
helpful insight could be that the prefixes used in the XSLT do *not*
have to be the same as the prefixes used in the source documents
(which, indeed, may not always be consistent with one another either).
Or anywhere else. Only the namespaces must correspond; the prefixes
are only a way to get to the namespaces.

So neither of these would match 'char' in no namespace; one matches
'char' in the xhtml namespace ... and so does the other:

<xsl:template match="char"
  xpath-default-namespace="http://www.w3.org/1999/xhtml">
    ... matches 'char' in the xhtml namespace

<xsl:template match="xh:char"
   xmlns:xh="http://www.w3.org/1999/xhtml">
   ... matches 'char' in ... the xhtml namespace


Hi Wendell and Wolfgang,

got it. Thanks for your explanation. The latter was exactly what I tried, but what did not work for me. What made me ask the question. I must have forgotten to specify the mode attribute so that the template did not fire.
Very glad to be on the 'understanding' track again.


Indeed, a helpful processor, when it sees both of these together in
the same XSLT, will warn you that you have a template clash. (Try it.
:-)
I use saxon, and indeed, it gives a warning.

Thank you both for helping me!

Ruud

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.