DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2005

    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 ?

    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>
    <Description>This is a good site</Description>
    <InputDate> 2005-12-23</InputDate>
    <Bookmark BId="fgdce3ak-846c-4e38-ab2f-8i03d9711b23">
    <Title>We ll e-mail your press release</Title>
    <Description>This is a good site</Description>
    <InputDate> 2004-11-23</InputDate>

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

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


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


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

    select @my


  2. #2
    Join Date
    Aug 2005
    local-name() is function to get the Element's name without any namespace prefix.
    for instance:
    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
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

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

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.