<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Question Re: OPENXML with Array an Attribute in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822485#M4853328</link>
    <description>&lt;P&gt;See the html_decode() and html_encode() builtin functions, the first should do exactly what you are trying to.&lt;/P&gt;</description>
    <pubDate>Tue, 21 Jul 2020 08:51:27 GMT</pubDate>
    <dc:creator>VolkerBarth</dc:creator>
    <dc:date>2020-07-21T08:51:27Z</dc:date>
    <item>
      <title>OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaq-p/13822476</link>
      <description>&lt;P&gt;I am trying to retrieve the value of Client Element which is a row in array returned as XML SOAP.&lt;/P&gt;
&lt;P&gt;I use the following call, but don't know why I dont get any result (and no any error too).&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;select * from openxml('&lt;/P&gt;
&lt;P&gt;&amp;lt;soap-env:envelope xmlns:soap-env="&lt;A href="http://schemas.xmlsoap.org/soap/envelope/" target="_blank"&gt;http://schemas.xmlsoap.org/soap/envelope/&lt;/A&gt;" xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;" xmlns:xsd="&lt;A href="http://www.w3.org/2001/XMLSchema" target="_blank"&gt;http://www.w3.org/2001/XMLSchema&lt;/A&gt;" xmlns:wsa="&lt;A href="http://schemas.xmlsoap.org/ws/2004/08/addressing" target="_blank"&gt;http://schemas.xmlsoap.org/ws/2004/08/addressing&lt;/A&gt;"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;lt;soap-env:body&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;lt;ns1:getdetailresponse xmlns:ns1="urn:tempuri:Ver1"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ns1:result xsi:nil="true"/&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;mydataset xmlns="urn:tempuri:Ver1"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;![CDATA[&amp;lt;?xml version="1.0"?&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;dsclients xmlns:xsi="&lt;A href="http://www.w3.org/2001/XMLSchema-instance" target="_blank"&gt;http://www.w3.org/2001/XMLSchema-instance&lt;/A&gt;"&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;ttclient&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;client&amp;gt;200403&amp;lt;/client&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/ttclient&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/dsclients&amp;gt;]]&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/mydataset&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;lt;/ns1:getdetailresponse&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;lt;/soap-env:body&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;lt;/soap-env:envelope&amp;gt;',&lt;/P&gt;
&lt;P&gt;'//*:Body/*:GetDetailResponse/*:MyDataset/*:DsClients/ttClient') with (CusotmerID varchar (100) 'Client');&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can anyone help please?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 11:18:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaq-p/13822476</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-07-15T11:18:10Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822477#M4853320</link>
      <description>&lt;P&gt;I'm not sure you can query the contents of a CDATA section via XPath directly - you might first need to extract it as a separate XML document here...&lt;/P&gt;
&lt;P&gt;Generally, when parsing "new XML documents" with OpenXML, I have learnt to use the meta properties within the WITH clause to make sure I'm querying the right nodes (and do not stumble over missing namespaces and the like, as I have done all too often)...&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 12:04:00 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822477#M4853320</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-07-15T12:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822478#M4853321</link>
      <description>&lt;P&gt;do you mean that I should extract the content of CDATA as text and then extract each element separately? i.e. should I need to use OPENXML twice?&lt;/P&gt;
&lt;P&gt;The problem is that I can't even extract the content of CDATA!&lt;/P&gt;
&lt;P&gt;By replacing the last line in the code above for example with:&lt;/P&gt;
&lt;P&gt;'//*:Body/*:GetDetailResponse/*:MyDataset') with (CusotmerID varchar (100) 'text()');&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 14:13:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822478#M4853321</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-07-15T14:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822479#M4853322</link>
      <description>&lt;P&gt;My main problem is not with CDATA, as I can replace &lt;STRONG&gt;&amp;lt;![CDATA[&amp;lt;?xml version="1.0"?&amp;gt;&lt;/STRONG&gt; with '' and &lt;STRONG&gt;]]&amp;gt;&lt;/STRONG&gt; with ''.&lt;/P&gt;
&lt;P&gt;I am not sure where exactly to use &lt;STRONG&gt;*:&lt;/STRONG&gt; and where not to use in the last line of the code&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 15:58:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822479#M4853322</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-07-15T15:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822480#M4853323</link>
      <description>&lt;P&gt;You can always use '*:' before any node/attribute name to allow any namespace - unless the XML actually &lt;STRONG&gt;does use identical names in different name spaces&lt;/STRONG&gt; so you have to distinguish the name spaces.&lt;/P&gt;
&lt;P&gt;But note that names are case-sensitive, while your sample does treat them as case-insensitive.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2020 16:08:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822480#M4853323</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-07-15T16:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822481#M4853324</link>
      <description>&lt;P&gt;Ok, clear.
One more question, what if some element has an embedded attribute in it, like:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&amp;lt;mydataset xmlns="urn:tempuri:Ver1"&amp;gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Do I need also to add &lt;U&gt;&lt;STRONG&gt;*:&lt;/STRONG&gt;&lt;/U&gt; too or &lt;U&gt;&lt;STRONG&gt;*:&lt;/STRONG&gt;&lt;/U&gt; is really only for the namespace preceeding the element name (something like &lt;STRONG&gt;ns1:&lt;/STRONG&gt; or &lt;STRONG&gt;ns2:&lt;/STRONG&gt; or whatsever).&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 04:21:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822481#M4853324</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-07-16T04:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822482#M4853325</link>
      <description>&lt;P&gt;As stated, I'd really recommend to use the metaproperties to try to list all nodes and attributes with their values - that's the easiest way IMHO to find out how to adapt the desired XPath queries.&lt;/P&gt;
&lt;P&gt;That being said, your last question is a general XML question better asked in general XML forums...&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 05:21:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822482#M4853325</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-07-16T05:21:49Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822483#M4853326</link>
      <description>&lt;P&gt;I could get the correct value of &lt;STRONG&gt;client&lt;/STRONG&gt; after correcting the following points:
&lt;/P&gt;&lt;OL&gt;
&lt;LI&gt;replace &lt;STRONG&gt;'&amp;lt;![CDATA[&amp;lt;?xml version="1.0"?&amp;gt;'&lt;/STRONG&gt; with ''&lt;/LI&gt;
&lt;LI&gt;replace &lt;STRONG&gt;']]&amp;gt;' with&lt;/STRONG&gt; ''&lt;/LI&gt;
&lt;LI&gt;replace &lt;STRONG&gt;'xmlns="urn:tempuri:Ver1"'&lt;/STRONG&gt; with ''&lt;/LI&gt;
&lt;LI&gt;correcting capital &amp;amp; small letters (case sensitive)&lt;/LI&gt;
&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;My question is, how can I deactivate the effect of &lt;STRONG&gt;CDATA&lt;/STRONG&gt;, so that I get the Data within &lt;STRONG&gt;CDATA&lt;/STRONG&gt; as Markup and not as literal text:&lt;/P&gt;
&lt;P&gt;In other words, I want to get:
&lt;/P&gt;&lt;DIV dir="ltr"&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;client&amp;gt;&lt;/SPAN&gt;200403&lt;SPAN&gt;&amp;lt;/client&amp;gt;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;instead of:&lt;/P&gt;
&lt;DIV dir="ltr"&gt;&lt;PRE&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt; &amp;amp; lt ; client &amp;amp; gt ; 200403 &amp;amp; lt ;/client &amp;amp; gt ;&lt;/SPAN&gt;
&lt;/PRE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 21 Jul 2020 06:12:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822483#M4853326</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-07-21T06:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822484#M4853327</link>
      <description>&lt;P&gt;Actually I could also solve this problem by:&lt;/P&gt;
&lt;P&gt;replace(mytext, '&amp;amp; lt ;' , '&amp;lt;');&lt;/P&gt;
&lt;P&gt;but this takes too long time, and I wanted to know whether there is some ready function for this.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 06:18:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822484#M4853327</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-07-21T06:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822485#M4853328</link>
      <description>&lt;P&gt;See the html_decode() and html_encode() builtin functions, the first should do exactly what you are trying to.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 08:51:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822485#M4853328</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-07-21T08:51:27Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822486#M4853329</link>
      <description>&lt;P&gt;Instead of using replace to "flatten" the CDATA contents, you might take the according node's contents and handle it as a separate XML document (which it is, obviously).&lt;/P&gt;</description>
      <pubDate>Tue, 21 Jul 2020 08:54:52 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822486#M4853329</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-07-21T08:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822487#M4853330</link>
      <description>&lt;P&gt;Thank you very much, yes &lt;STRONG&gt;html_decode()&lt;/STRONG&gt; does what I want.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 03:18:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822487#M4853330</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-07-22T03:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822488#M4853331</link>
      <description>&lt;P&gt;Yes, this is what I want, but I can't bring these together.&lt;/P&gt;
&lt;P&gt;Is there any simple example showing how to deal with &lt;STRONG&gt;CDATA&lt;/STRONG&gt;?&lt;/P&gt;</description>
      <pubDate>Wed, 22 Jul 2020 03:18:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822488#M4853331</guid>
      <dc:creator>Baron</dc:creator>
      <dc:date>2020-07-22T03:18:57Z</dc:date>
    </item>
    <item>
      <title>Re: OPENXML with Array an Attribute</title>
      <link>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822489#M4853332</link>
      <description>&lt;P&gt;There are XPath functions to do so according to the internets, but I guess those are not supported by SQL Anywhere's subset of XPath functions.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 10:06:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/openxml-with-array-an-attribute/qaa-p/13822489#M4853332</guid>
      <dc:creator>VolkerBarth</dc:creator>
      <dc:date>2020-07-24T10:06:55Z</dc:date>
    </item>
  </channel>
</rss>

