XSLT & xmlns

Discussion in 'XML' started by rufio, Aug 10, 2003.

  1. rufio

    rufio Guest

    Hi all
    I have a <xsl:template> that matches an <element>, but i found that this
    template doesn't match <element xmlns="URL">.

    Why and how to match it?


    Regards, Rufio
    rufio, Aug 10, 2003
    #1
    1. Advertising

  2. rufio

    Mike Brown Guest

    "rufio" <ruf(number(ten))@op.pl> wrote in message
    news:bh4hu5$cdh$...
    > Hi all
    > I have a <xsl:template> that matches an <element>, but i found that this
    > template doesn't match <element xmlns="URL">.
    >
    > Why and how to match it?


    Why:

    The matching is done based on the "expanded name" of the element. The
    expanded name is two pieces of information: the "local name" (whatever comes
    after the prefix, if there is one, otherwise, just the name), and the
    "namespace", which is the URI. In other words, element nodes named
    'element'-in-no-namespace are not the same as element nodes named
    'element'-in-the-'URL'-namespace.

    How:

    In your stylesheet, bind the namespace 'URL' to a prefix, and match
    thatprefix:element.
    Mike Brown, Aug 10, 2003
    #2
    1. Advertising

  3. rufio

    rufio Guest

    on Sun, 10 Aug 2003 04:49:29 GMT "Mike Brown" <> wrote:

    > In your stylesheet, bind the namespace 'URL' to a prefix, and match
    > thatprefix:element.


    Thanks, it works

    Is there a way to omit theprefix in each step, like in
    prefix:god/prefix:damn/prefix:prefixes ?


    Regards, Rufio
    rufio, Aug 10, 2003
    #3
  4. rufio

    Mike Brown Guest

    > Is there a way to omit theprefix in each step, like in
    > prefix:god/prefix:damn/prefix:prefixes ?


    XSLT 2.0 / XPath 2.0 will have such a feature.
    XSLT 1.0 / XPath 1.0 does not. Sorry :)
    Mike Brown, Aug 10, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rosa Mª Gómez Flores

    XSLT: I don't get the xmlns in target

    Rosa Mª Gómez Flores, Oct 11, 2003, in forum: XML
    Replies:
    7
    Views:
    530
    Dimitre Novatchev
    Oct 14, 2003
  2. cyclops
    Replies:
    4
    Views:
    785
    cyclops
    Feb 17, 2005
  3. Replies:
    0
    Views:
    1,313
  4. Rajesh
    Replies:
    0
    Views:
    373
    Rajesh
    Jul 18, 2006
  5. afshar
    Replies:
    3
    Views:
    24,102
    aljar
    May 19, 2010
Loading...

Share This Page