At 2006-09-14 19:43 +0100, Martin Bryan wrote:
>The problem seems to be that attributes in the xmlns namespace can't be
>picked up using @*. How can I get them to transfer indirectly?
In XSLT you address namespaces by looking along the namespace:: axis.
<xsl:for-each select="namespace::*">
Prefix: <xsl:value-of select="name(.)"/>
URI: <xsl:value-of select="."/>
</xsl:for-each>
If I have a variable named "x" that has a URI, I find the namespace node by:
select="namespace::*[.=$x]"
If I have a variable named "y" that has a prefix I find the namespace node by:
select="namespace::*[name(.)=$y]"
Here is some logic (from the
http://www.oasis-open.org/committees/document.php?document_id=16765
package) where I synthesize Schematron <ns>
declarations that will handle all namespaces for
any document, without relying on prefix-based
processing (except for grabbing the code list
namespace from the stylesheet), just URI-based processing:
<!--this shortcut makes some namespace work more succinct in the stylesheet-->
<xsl:variable name="clc-namespace" select="document('')/*/namespace::clc"/>
<!--work from the associated files-->
<xsl:variable name="namespaces" select="$assoc-file//namespace::*"/>
<!--declare namespaces assumed to be used for XPath addresses-->
<xsl:for-each select="$namespaces">
<xsl:if test="generate-id(.)=
generate-id($namespaces[name(.)=name(current())][1]) and
name(.) != 'xml' and . != $clc-namespace" >
<ns uri="{.}" prefix="{name(.)}"/>
<xsl:copy-of select="$indent"/>
</xsl:if>
</xsl:for-each>
A lot can be done with XSLT 1.0 and the namespace
axis ... for example, the above code in
Schematron stylesheets might have prevented the
need to create the "<ns>" element in the language (but it is there now).
I haven't looked at the rest of the message, this
just jumped out at me as something quick to
answer as that is all I can manage these days.
I hope this helps.
. . . . . . . . . Ken
-- UBL/XML/XSLT/XSL-FO training: Vårø, Denmark 2006-10-02/06,11-20/24 UBL International 2006 2006-11-13/17 http://www.ublconference.com World-wide corporate, govt. & user group UBL, XSL, & XML training. G. Ken Holman mailto:gkholman@CraneSoftwrights.com Crane Softwrights Ltd. http://www.CraneSoftwrights.com/d/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Cancer Awareness Aug'05 http://www.CraneSoftwrights.com/d/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal -- DSDL members discussion list To unsubscribe, please send a message with the command "unsubscribe" to dsdl-discuss-request@dsdl.org (mailto:dsdl-discuss-request@dsdl.org?Subject=unsubscribe)Received on Fri Sep 15 00:56:10 2006
This archive was generated by hypermail 2.1.8 : Mon Sep 25 2006 - 18:43:01 UTC