xsl-list
[Top] [All Lists]

AW: [xsl] XSL 1.1 -> Asking for an attribut namespace

2006-03-30 03:28:35
"name() should return the lexical QName of the attribute, that is
'fo:text-align'"

I checked this with the Oxygen Debugger. The returned string ist just
"text-align" :(. May that have something to do with my namespace
declarations in the stylesheets?
<xsl:stylesheet version="1.1"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
                              xmlns:fo="http://www.w3.org/1999/XSL/Format";
                              xmlns:svg="http://www.w3.org/2000/svg";
                              xmlns:xlink="http://www.w3.org/1999/xlink";
                              xmlns:saxon="http://icl.com/saxon";
extension-element-prefixes="saxon">




-----Ursprüngliche Nachricht-----
Von: Michael Kay [mailto:mike(_at_)saxonica(_dot_)com]
Gesendet: Mittwoch, 29. März 2006 17:10
An: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Betreff: RE: [xsl] XSL 1.1 -> Asking for an attribut namespace 


name() should return the lexical QName of the attribute, that is
"fo:text-align". However, you don't want to be testing namespace prefixes,
because users are allowed to choose any prefix they like. The construct you
want is

<xsl:copy-of select="..../@fo:*"/>

No need for the for-each and the xsl:if.

Michael Kay
http://www.saxonica.com/ 

-----Original Message-----
From: news(_at_)swisslab(_dot_)de [mailto:news(_at_)swisslab(_dot_)de] 
Sent: 29 March 2006 15:39
To: 'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: [xsl] XSL 1.1 -> Asking for an attribut namespace 

Hello List,

I've a XML:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"  ?>
<Spalten xmlns:fo="http://www.w3.org/1999/XSL/Format";>
    <Datenursprung>//SVERLAUF</Datenursprung>
    <Spalte anzahl="1" breite-in-prozent="3" text-align="right">
        <Titel fix="true"></Titel>
        <Data fix="true" fo:text-align="right">position()</Data>
    </Spalte>
</Spalten>

The problem I have comes when I try to copy all attributes of 
the <Data/>
node into my result dataset. I want to copy each attribut as 
long as it has
a namespace of "fo:".

  <xsl:for-each select="$ListData/Spalten/Spalte[$i]/@*">    
    <xsl:if test="starts-with(name(), 'fo:')">
      <xsl:copy-of select="."/>
    </xsl:if>
  </xsl:for-each>

name() always gives me back the correct name, but without the 
namespace of
the attribut. I want to filter ther attributes this way since 
I dont want to
have attributes like "anzahl" in my FO result dataset.

Doeas anybody hase a idea how I can solve my probem?
Thanks & with best regards, Jan


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





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



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