XML query like SQL?

Is there any environment for querying SQL Server XML syntax, I'm seriously tired of repeating through node lists.


Or is it just wishful thinking (if not idiotic) and, of course, impossible, since XML is not a relational database?
+6
language-agnostic sql xml frameworks
source share
7 answers

XQuery and XPath ... XQuery is more than what you are looking for if an SQL structure is desired.

+13
source share

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

You can even create queries that join together between tables, etc.

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

+2
source share

You can try LINQ to XML, but it is not an agnostic language.

+2
source share

XQuery is the functional language closest to SQL. XPath is the designation for placing a node in a document that is used as part of XSLT and XQuery.

XML databases, such as MarkLogic , serve as XQuery engines for XML data, as relational databases serve as SQL engines for relational data.

+1
source share

It depends on the problem you are solving. If the XML file is quite large, sometimes you need to use something like SAX parsers to move the node file to node, or you will get an OutOfMemoryException or even end virtual memory on your computer.

But if the expected size of the XML file is relatively small, you can just use something like Linq, also see my answer - here I tried to explain how to make navigating through nodes much easier with constructs like yield return .

+1
source share

SQL Server 2005 supports XML DML in it native xml data type.

0
source share

XQuery is definitely the way forward. This is what is used by XML databases such as eXist and MarkLogic .

In the Java world, there are several solutions for running XQuery on flat files, especially Saxon

There are not many available for .NET. Microsoft had the XQuery library, although it was extracted from .NET 2 and never appeared. XQSharp is a native alternative to .NET, although only the command line version is currently released.

0
source share

All Articles