DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How can I query the node in XML with XQuery?

  1. #1
    Join Date
    Aug 2005
    Posts
    37

    How can I query the node in XML with XQuery?

    How can I query the node in XML with XQuery?


    1. I store the xml info below in the XML field Demographics in SQL 2005, I hope to query all the node info with XQuery.

    The result just like
    <Folder Name="Root" Id="a6dce8fe-749c-4e38-ab2f-3d03d9711b3d">
    <Folder Name="Card" Id="b8dcf8fe-749c-4e38-ab2f-6d03d9711b8j">
    </Folder>
    </Folder>

    but I can't get the correct result using
    select Demographics.query('/Folder') from store



    2. Furthermore, How can I query the Name attribute of the Folder node by ID of Folder using XQuery,
    If so, I can get the Name (such as "Root") after I know the ID "a6dce8fe-749c-4e38-ab2f-3d03d9711b3d"



    3. Can I get the result below using XQuery? (Notice: the sub Name="Card" have no content )

    <Folder Name="Root" Id="a6dce8fe-749c-4e38-ab2f-3d03d9711b3d">
    <Bookmark>
    <Title>CodeGuru Forums - ASP.NET</Title>
    <Url>http://www.codeguru.com/</Url>
    </Bookmark>
    <Bookmark>
    <Title>We will e-mail your press release</Title>
    <Url>http://www.dpdirectory.com/</Url>
    </Bookmark>

    <Folder Name="Card" Id="b8dcf8fe-749c-4e38-ab2f-6d03d9711b8j">
    </Folder>

    </Folder>


    Could you help me? Thanks!


    =========================XML Info=====================================

    <Folder Name="Root" Id="a6dce8fe-749c-4e38-ab2f-3d03d9711b3d">
    <Bookmark>
    <Title>CodeGuru Forums - ASP.NET</Title>
    <Url>http://www.codeguru.com/</Url>
    <Description>This is a good site</Description>
    <InputDate> 2005-12-5</InputDate>
    <IsPrivate>False</IsPrivate>
    </Bookmark>
    <Bookmark>
    <Title>We will e-mail your press release</Title>
    <Url>http://www.dpdirectory.com/</Url>
    <Description>This is a good site</Description>
    <InputDate> 2004-12-5</InputDate>
    <IsPrivate>False</IsPrivate>
    </Bookmark>
    <Folder Name="Card" Id="b8dcf8fe-749c-4e38-ab2f-6d03d9711b8j">
    <Bookmark>
    <Title>Welcome to ePassporte</Title>
    <Url>https://www.epassporte.com/</Url>
    <Description>Very Good</Description>
    <InputDate> 2004-08-5</InputDate>
    <IsPrivate>True</IsPrivate>
    </Bookmark>
    <Bookmark>
    <Title>Keystone DreamCard</Title>
    <Url>https://www.mydreamcardonline.com</Url>
    <Description>Please note</Description>
    <InputDate> 2004-08-5</InputDate>
    <IsPrivate>True</IsPrivate>
    </Bookmark>
    </Folder>
    </Folder>

    ======================XML Info=====================================

  2. #2
    Join Date
    Sep 2005
    Posts
    3

    same problem here

    hi brother..................

    well i have the same problem and i gana tell u as soon i know

    but can u tell me yr way of quering for this case at yr xml file

    select title form xml file where discription="this nis a good site"

    thank u

    if u send me yr email gana send some useful zip file relates for this matter

Similar Threads

  1. Replies: 0
    Last Post: 09-30-2002, 09:29 AM
  2. Try XML Junction
    By Tim in forum xml.announcements
    Replies: 0
    Last Post: 10-11-2001, 04:00 PM
  3. EMERGENT.... double linked list
    By mary in forum Java
    Replies: 0
    Last Post: 07-20-2001, 08:42 AM
  4. Data Junction Announces XML Junction 7.51
    By Tim Frost in forum xml.announcements
    Replies: 0
    Last Post: 04-02-2001, 10:53 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