What does the "local-name" mean?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: What does the "local-name" mean?

  1. #1
    Join Date
    Aug 2005
    Posts
    37

    What does the "local-name" mean?

    What does the "local-name" mean?

    After you read the code below, could you tell me what the "local-name" mean? is the "local-name" a constant ?


    //--------------------Code-------------------------------
    declare @my xml

    set @my='
    <Folder Name="Root" Id="a6dce8fe-749c-4e38-ab2f-3d03d9711b3d">
    <Bookmark BId="f8dce8hj-846c-4e38-ab2f-6d03d9711b80">
    <Title>CodeGuru Forums - ASP.NET</Title>
    <Url>http://www.codeguru.com/</Url>
    <Description>This is a good site</Description>
    <InputDate> 2005-12-23</InputDate>
    <IsPrivate>False</IsPrivate>
    </Bookmark>
    <Bookmark BId="fgdce3ak-846c-4e38-ab2f-8i03d9711b23">
    <Title>We ll e-mail your press release</Title>
    <Url>http://www.dpdirectory.com/</Url>
    <Description>This is a good site</Description>
    <InputDate> 2004-11-23</InputDate>
    <IsPrivate>False</IsPrivate>
    </Bookmark>

    <Folder Name="Card1" Id="b8dcf8fe-749c-4e38-ab2f-6d03d9711b8j">
    <Bookmark BId="ghdce3ak-456c-4e38-ab2f-5h02d9711b67">
    <Title>Welcome to ePassporte</Title>
    <Url>https://www.epassporte.com/</Url>
    <Description>Very Good</Description>
    <InputDate> 2004-08-12</InputDate>
    <IsPrivate>True</IsPrivate>
    </Bookmark>
    <Bookmark BId="fkdfh3a8-456c-6y38-jk2f-5h0gh9711b45">
    <Title>Keystone DreamCard</Title>
    <Url>https://www.mydreamcardonline.com</Url>
    <Description>Please note</Description>
    <InputDate> 2004-09-25</InputDate>
    <IsPrivate>True</IsPrivate>
    </Bookmark>

    <Folder Name="Card1in1" Id="l9dcf8fe-689c-0935-fghj-7u03d9711b5t">
    <Bookmark BId="ghdfh3a8-896c-6y40-jkfg-5h0gh9711b89">
    <Title>The News of CNN</Title>
    <Url>https://www.cnn.com</Url>
    <Description>Please note</Description>
    <InputDate> 2004-09-23</InputDate>
    <IsPrivate>True</IsPrivate>
    </Bookmark>
    </Folder>

    </Folder>

    <Folder Name="Card2" Id="67dcf8fe-734c-4e56-ab2f-6d03d9711bfg">
    </Folder>

    </Folder>
    '


    set @my.modify('delete (//*[local-name(.) != "Folder"], //text()) ')

    select @my

    //--------------------Code-------------------------------

  2. #2
    Join Date
    Aug 2005
    Posts
    23
    local-name() is function to get the Element's name without any namespace prefix.
    for instance:
    <a>
    <ns0:a>
    are two entirely different elements.
    so to match them you need to use //*ns:a or //*a in XPath.
    to just get ANY a named element //*[local-name() == "a"]

Similar Threads

  1. Replies: 0
    Last Post: 12-11-2002, 07:46 AM
  2. Replies: 0
    Last Post: 12-11-2002, 07:45 AM
  3. making "Class Name" drop list alphabetic
    By Denny Moore in forum .NET
    Replies: 0
    Last Post: 03-27-2002, 06:14 PM
  4. Replies: 0
    Last Post: 06-04-2001, 08:03 PM
  5. Replies: 0
    Last Post: 07-05-2000, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center