-
1. SQL query against web service vdb
shawkins Feb 26, 2011 10:23 AM (in response to kochk)Hi Kellie,
The simplest extraction ignoring namespaces would be:
xpathValue(val, '/*:processResponse/*:return')
That uses the Saxon wildcard matching for namespaces. The equivalent in more standard xpath is:
xpathValue(val, '/*[local-name()="processResponse"]/*[local-name()="return"]')
Both of those will work fine in Teiid. If you are extracting more than just the string value or want to be namespace aware then xmlquery is the way to go.
Steve
-
2. SQL query against web service vdb
shawkins Feb 26, 2011 4:19 PM (in response to shawkins)An example of namespaces with XMLQUERY to extract just the hello value from this doc would be:
XMLSERIALIZE(XMLQUERY(XMLNAMESPACES(NO DEFAULT, 'http://com.test.ws/exampleWebService' AS ns1), '/ns1:processResponse/return/text()' PASSING value NULL ON EMPTY) AS STRING)
where value is your xml document value.
Steve
-
3. SQL query against web service vdb
kochk Feb 28, 2011 10:05 AM (in response to shawkins)Thanks Steven! Both of those examples worked for me.