RE: [xsl] Find the root element from an attribute node

Subject: RE: [xsl] Find the root element from an attribute node
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Fri, 11 Jul 2008 11:23:26 -0400
At 2008-07-11 16:15 +0100, Marroc wrote:
Document:

<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="file:/c:/SSPub/15/17/System/xhtml/css/xhtml.css"
type="text/css"?>
<!DOCTYPE html SYSTEM
"file:/c:/SSPub/15/17/System/xhtml/dtd/xhtml1-transitional.dtd">

My mailer ate the rest of your message so I cannot read it.


Xsl:
<?xml version='1.0'?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
        <xsl:template match="/html">
                Boo to a goose
        </xsl:template>
</xsl:stylesheet>

Is there a way to say "any namespace"?

Since you are using XSLT 2: match="/*:html"


Why isn't that the default?

Because there would be no other way to say "the element <html> in no namespace".


This convention for no prefix has been true since XSLT was standardized in 1999 ... the new syntax for match patterns of "*:name" is new with XSLT 2.

I hope this helps.

. . . . . . . Ken

--
Upcoming XSLT/XSL-FO hands-on courses:      Wellington, NZ 2009-01
World-wide corporate, govt. & user group XML, XSL and UBL training
RSS feeds:     publicly-available developer resources and training
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Box 266, Kars, Ontario CANADA K0A-2E0    +1(613)489-0999 (F:-0995)
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

Current Thread