Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Querying XML like SQL?

Is there any framework for querying XML SQL Syntax, I seriously tire of iterating through node lists.


Or is this just wishful thinking (if not idiotic) and certainly not possible since XML isn't a relational database?
like image 407
Peter Turner Avatar asked Sep 26 '08 17:09

Peter Turner


Video Answer


3 Answers

XQuery and XPath... XQuery is more what you are looking for if a SQL structure is desirable.

like image 130
dacracot Avatar answered Oct 18 '22 03:10

dacracot


You could try LINQ to XML, but it's not language agnostic.

like image 2
Chris Cudmore Avatar answered Oct 18 '22 02:10

Chris Cudmore


.Net Framework provides LINQ to do this or you can use the .Net System.Data namespace to load data from XML files.

You can even create queries that have joins among the tables, etc.

For example, System.Data.DataTable provides a ReadXml() method.

like image 2
Craig Eddy Avatar answered Oct 18 '22 01:10

Craig Eddy