[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] getting node type in xsl


Subject: Re: [xsl] getting node type in xsl
From: Jan Limpens <jan.limpens@xxxxxxxxx>
Date: Wed, 8 Sep 2004 16:49:48 -0300

hi,

I became aware of the .net saxon port yesterday. sounds very
interesting, but the early beta stage frightened me a bit and I
thought - monitor this a while and see how active the project is...

I don4t feel to much cornered by MS's xslt 2.0 refusal. The more I use
standard "w3c" xml, independent of it's version the more independent I
am of MS. Big parts of my applications I could move quite effortlessly
to another application platform.
Still, how does xslt 2.0 without the schema aware extension help me in
my problem nr. 1?

Right now, my idea is to create a custom control I place instead of
the simple input control, that back checks via a schema aware
xmlreader the current node's schema and provides the right input
logic. Therefore I'd need the node's xpath as a parameter (if I want
to use xslt to produce the interface, which I deem quite elegant). And
surely I'll give David's theory a try.

So, anyone got an idea about nr. 2 (using the stylesheet to produce an
element's xpath something I can print out)?
I tried

  <xsl:template
   match="node()">
   <xsl:variable name="xpath" select="concat(../$xpath, '/',
local-name(),'[', position(), ']')"/>
    <fieldset>
      <legend>
        <xsl:value-of
         select="$xpath" />
      </legend>
...

but this obviously does not work (but shows my intention) and position
does not give me the value I want (the occurrence of _one_
element-type in a branch)

help greatly appreciated :D (now that's news ;) )

jan


Current Thread
Keywords