473,498 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Invalid XML content error when Select unnest(xpath... is used

1 New Member
I have a text column named bid_xml in my table which has the following value:
Expand|Select|Wrap|Line Numbers
  1. <?xml version=1.0 encoding=UTF-8?>
  2. <dpid:DpidDatabase xmlns:dpid=http://ddex.net/xml/dpid/11 xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xsi:schemaLocation=http://ddex.net/xml/dpid/11 http://ddex.net/xml/dpid/11/dpid.xsd>
  3.  <DpidOwner SequenceNumber=1>
  4.   <DPID>PADPIDA2006111001O</DPID>
  5.   <CompanyName>234AG</CompanyName>
  6.   <Address>Riedtlistrasse 23, Zürich, 8006, CH</Address>
  7.  </DpidOwner>
  8.  <DpidOwner SequenceNumber=2>
  9.   <DPID>PADPIDA2007011501Q</DPID>
  10.   <CompanyName>OpenIMP</CompanyName>
  11.   <Address>8-10 Rhoda Street, London, E2 7EF, UK</Address>
  12.  </DpidOwner>
  13.  <DpidOwner SequenceNumber=3>
  14.   <DPID>PADPIDA2007040501K</DPID>
  15.   <CompanyName>The Harry Fox Agency</CompanyName>
  16.   <Address>711 Third Avenue, 8th Floor, New York, 10017, USA</Address>
  17.  </DpidOwner>
  18. </dpid:DpidDatabase>
Execute query:
Expand|Select|Wrap|Line Numbers
  1. SELECT 
  2.   unnest((xpath('/dpid:DpidDatabase/DpidOwner',  int_config.ddex_dpid_xml_20190828.big_xml::xml,ARRAY[ARRAY['dpid', 'http://ddex.net/xml/dpid/11']]))) AS SequenceNumber   
  3.   ,unnest((xpath('/dpid:DpidDatabase/DpidOwner/DPID',  int_config.ddex_dpid_xml_20190828.big_xml::xml,ARRAY[ARRAY['dpid', 'http://ddex.net/xml/dpid/11']]))) AS DPID
  4.   ,unnest((xpath('/dpid:DpidDatabase/DpidOwner/CompanyName',  int_config.ddex_dpid_xml_20190828.big_xml::xml,ARRAY[ARRAY['dpid', 'http://ddex.net/xml/dpid/11']]))) AS CompanyName 
  5.   ,unnest((xpath('/dpid:DpidDatabase/DpidOwner/Address',  int_config.ddex_dpid_xml_20190828.big_xml::xml,ARRAY[ARRAY['dpid', 'http://ddex.net/xml/dpid/11']]))) AS Address
  6. FROM int_config.ddex_dpid_xml_20190828
Error displayed:
Expand|Select|Wrap|Line Numbers
  1. ERROR: invalid XML content
  2.   Detail: line 1: XML declaration allowed only at the start of the document
  3. <?xml version=1.0 encoding=UTF-8?>
  4.         ^
  5. 1 statement failed.
Aug 30 '19 #1
0 2263

Sign in to post your reply or Sign up for a free account.

Similar topics

5
2097
by: sriram | last post by:
I have the following: class BSA { ... ... ... ... public: enum VRGAttrId {
4
10688
by: Bradley Kite | last post by:
Hi all. I'm trying to diagnose/solve a problem with internet explorer, whereby sometimes the form submits, and other times IE produces an 'invalid syntax' error. First, I have a form, and...
1
4149
by: Andrew McNab | last post by:
Hi folks, I have a problem with an MS Access SQL query which is being used in an Access Report, and am wondering if anyone can help. Basically, my query (shown below) gets some records from a...
8
3356
by: Owen Jenkins | last post by:
Hello. For years I've been using the DBEngine.CompactDatabase code to make backups of backend databases. But now I've struck a baffling problem where I get an Invalid Argument error. This...
6
2833
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
6
1737
by: GP | last post by:
We get " Object reference not set to an instance of an object. " error in all the links whenever the browser is not used for more than 5 minutes. In IIS 5.0 version we are setting the session time...
2
5715
by: Schorschi | last post by:
Can't seemd to get ReadFile API to work! Returns invalid handle error? =========================================================================== Ok, the visual basic gurus, help! The...
5
3609
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
0
1625
by: J.Edwards | last post by:
I'm getting this error when trying to use a control built in VS 2003 (1.1) in a new asp project in VS 2005. "Content controls can only be used in a content page" The control has always worked...
0
1383
by: DCC700 | last post by:
After converting a web application to 2005, I am receiving an invalid character error when I change the value in a dropdown list. The dropdown list is set to postback on selected index changed and...
0
6998
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6884
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7375
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5460
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1416
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
287
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.