on 2017 Mar 03 9:44 AM
I'm trying to analyse a quite complex (and unfortunately mainly undocumented) XML document via SA's OpenXML() operator.
While it's easy to return all nodes with a particular value, I need to get to know their according absolute pathes.
Is there a way to do so, except recursively accessing the parent node? (With DOM, I would use the getNodePath() function.)
The XPath 3 path() function would help here but seems to be unsupported with v16:
select * from openxml(using value varXml, '//*') with (ID int '@mp:id', ElementName long varchar '@mp:localname', ParentElementName long varchar '../@mp:localname', -- I'd prefer not to need to extend that to further levels... GrandParentElementName long varchar '../../@mp:localname', ElementText long varchar 'text()', -- ElementPath long varchar 'path()', -- not supported ElementXmlText long varchar '@mp:xmltext') DT where ElementText = <desired value="">;
Request clarification before answering.
User | Count |
---|---|
52 | |
6 | |
5 | |
5 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.