non-prefixed xmlns attribute

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Michael TEpperis

    #1

    non-prefixed xmlns attribute

    hello,

    my xml files starts with

    +++++++
    <?xml version='1.0' encoding='utf-8' ?>
    <?integrity app='Visio' version='10.0' buildnum='525' metric='1'
    key='004FEC3B32 9899673AA9E1A9C 449A33530032E84 09CF468FD94A9ED 64401BE57D34810 31BF2985FFCA928 9E12A566C4F6ACC EAC545D0A4495E4 BCEB25B859ED4'
    keystart='261' ?>

    <VisioDocumen t xmlns='urn:sche mas-microsoft-com:office:visi o'>
    <DocumentProper ties>
    ....

    ++++++++

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

    <xsl:apply-templates select = "//DocumentPropert ies"/>

    but if I erase the xmlns attribute, I succeed.

    why?

    tia

    Michael Tepperis-von der Ohe
    logicacmg - germany
  • Richard Tobin

    #2
    Re: non-prefixed xmlns attribute

    In article <967b8653.04051 71029.5a58cf1f@ posting.google. com>,
    Michael TEpperis <tepperis@web.d e> wrote:
    [color=blue]
    ><VisioDocume nt xmlns='urn:sche mas-microsoft-com:office:visi o'>
    ><DocumentPrope rties>[/color]

    The name of this element is DocumentPropert ies in the namespace
    urn:schemas-microsoft-com:office:visi o.
    [color=blue]
    > <xsl:apply-templates select = "//DocumentPropert ies"/>[/color]

    This matches elements called DocumentPropert ies in no namespace.

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

    <xsl:apply-templates xmlns:z="urn:sc hemas-microsoft-com:office:visi o"
    select = "//z:DocumentPrope rties"/>

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

    -- Richard

    Comment

    Working...