[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

XML Select

Posted on 2011-03-01
5
Medium Priority
?
292 Views
Last Modified: 2012-05-11
How do I do a select so that these items are at the top and bottom of my created XML?

Is there a way to pick up the top tag automatically?

<?xml version = "1.0" encoding = "UTF-8"?>
<Document>

</Document>
0
Comment
Question by:lrbrister
  • 2
  • 2
5 Comments
 
LVL 7

Accepted Solution

by:
Chandan_Gowda earned 1000 total points
ID: 35007531
To achieve your requirement. You have to use xpath query.

please follow the below link, It will clearly explain how to use xpath query to select xml elements from an xml
http://support.microsoft.com/kb/308333
0
 
LVL 42

Assisted Solution

by:Meir Rivkin
Meir Rivkin earned 1000 total points
ID: 35008000
to verify that your xml has the declaration at the top (version and encoding) and the first node is "Document":
XDocument xdoc = XDocument.Load(@"c:\temp\test.xml");
            if (xdoc.Declaration != null && xdoc.Root.Name.LocalName == "Document")
            {

            }

Open in new window

0
 

Author Comment

by:lrbrister
ID: 35017112
Ok guys...both had valuable input.

Any problems with splitting points?
0
 
LVL 42

Expert Comment

by:Meir Rivkin
ID: 35017136
0
 

Author Closing Comment

by:lrbrister
ID: 35028526
Both are valid answers and very useful.
0

Featured Post

Free recovery tool for Microsoft Active Directory

Veeam Explorer for Microsoft Active Directory provides fast and reliable object-level recovery for Active Directory from a single-pass, agentless backup or storage snapshot — without the need to restore an entire virtual machine or use third-party tools.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question