DotJoshJohnson / vscode-xml

XML Tools for Visual Studio Code
MIT License
325 stars 86 forks source link

How do I run queries for retrieving XML data? #205

Closed bergamin closed 6 years ago

bergamin commented 6 years ago

Hello folks

I'm new to XQuery and I've got myself in a messy XML madness here where I need to look for certain tags and values in them.

Your Wiki page is mostly blank and after installing the extension, I can't really see any difference in interface when I open an XML file other than a tree-view on the left. Is there some kind of command prompt where I can type the queries I need for the file I opened? How do I activate that?

Do I need some kind of extra "compiler" to execute the queries? If yes, where can I get one?

Thanks

DotJoshJohnson commented 6 years ago

@bergamin - When it comes to XQuery, this extension simply provides a way to execute an external tool -it does not contain any built-in XQuery evaluation logic. There are a handful of products out there such as Saxon and Altova. Any product that provides a command-line interface to execute XQuery scripts can be used with the XML Tools extension.

With the above said, if you really do need to just query an XML document for a specific node to get its value, you may want to look into using XPath alone. XQuery is a superset of XPath that adds a lot more cruft if you don't need to take advantage of it.

bergamin commented 6 years ago

Thank you very much, @DotJoshJohnson. That helped me a lot. I'll take a look on those. BTW, you are correct. I just need to query the values in specific tags and tag parameters. I'll also look for XPath then.