non-prefixed xmlns attribute

Discussion in 'XML' started by Michael TEpperis, May 17, 2004.

  1. hello,

    my xml files starts with

    +++++++
    <?xml version='1.0' encoding='utf-8' ?>
    <?integrity app='Visio' version='10.0' buildnum='525' metric='1'
    key='004FEC3B329899673AA9E1A9C449A33530032E8409CF468FD94A9ED64401BE57D3481031BF2985FFCA9289E12A566C4F6ACCEAC545D0A4495E4BCEB25B859ED4'
    keystart='261' ?>

    <VisioDocument xmlns='urn:schemas-microsoft-com:eek:ffice:visio'>
    <DocumentProperties>
    ....

    ++++++++

    with the following xslt rule I don't have results:

    <xsl:apply-templates select = "//DocumentProperties"/>

    but if I erase the xmlns attribute, I succeed.

    why?

    tia

    Michael Tepperis-von der Ohe
    logicacmg - germany
     
    Michael TEpperis, May 17, 2004
    #1
    1. Advertising

  2. In article <>,
    Michael TEpperis <> wrote:

    ><VisioDocument xmlns='urn:schemas-microsoft-com:eek:ffice:visio'>
    ><DocumentProperties>


    The name of this element is DocumentProperties in the namespace
    urn:schemas-microsoft-com:eek:ffice:visio.

    > <xsl:apply-templates select = "//DocumentProperties"/>


    This matches elements called DocumentProperties in no namespace.

    To match elements in the namespace urn:schemas-microsoft-com:eek:ffice:visio,
    you need to declare a prefix for it in the stylesheet and use that prefix:

    <xsl:apply-templates xmlns:z="urn:schemas-microsoft-com:eek:ffice:visio"
    select = "//z:DocumentProperties"/>

    If you're going to use the prefix in other places too, declare it on the
    stylesheet element.

    -- Richard
     
    Richard Tobin, May 17, 2004
    #2
    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. Quentin Huo

    What's directories prefixed "_vti"?

    Quentin Huo, Jun 7, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,455
    Juan T. Llibre
    Jun 7, 2005
  2. Simon Harris

    Pound sign - Prefixed with Â

    Simon Harris, Jan 28, 2005, in forum: HTML
    Replies:
    3
    Views:
    12,289
    Simon Harris
    Jan 29, 2005
  3. Michael TEpperis

    non-prefixed xmlns attribute

    Michael TEpperis, May 17, 2004, in forum: XML
    Replies:
    0
    Views:
    366
    Michael TEpperis
    May 17, 2004
  4. Replies:
    0
    Views:
    1,433
  5. afshar
    Replies:
    3
    Views:
    24,934
    aljar
    May 19, 2010
Loading...

Share This Page