Home » Developer & Programmer » JDeveloper, Java & XML » Problem with namespaces in XML
Problem with namespaces in XML [message #479195] Fri, 15 October 2010 02:16 Go to next message
czinsou
Messages: 23
Registered: August 2009
Junior Member
Hi, here is the xml stored :
<?xml version="1.0" encoding="UTF-8"?>
<InvoiceTransmission xmlns="http://www.IATA.com/IATAAviationInvoiceStandard" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.IATA.com/IATAAviationInvoiceStandard
http://www.iata.org/whatwedo/finance/clearing/sis/Documents/schemas/IATA_IS_XML_Invoice_Standard_V3.0.xsd">
	<TransmissionHeader>
		<TransmissionDateTime>2001-12-17T09:30:47Z</TransmissionDateTime>
		<Version>IATA:ISXMLInvoiceV3.0</Version>
		<IssuingOrganizationID>0075</IssuingOrganizationID>
		<BillingCategory>Cargo</BillingCategory>
	</TransmissionHeader>
....
</InvoiceTransmission>

Here is the SQL statement that I run to get "TransmissionHeader" infos :
SELECT a.TransmissionDateTime,a.Version, a.IssuingOrganizationID,a.ReceivingOrganizationID,a.BillingCategory
FROM XMLT,
XMLTABLE('/InvoiceTransmission/TransmissionHeader'
PASSING XMLT.data COLUMNS
TransmissionDateTime VARCHAR2(50) PATH 'TransmissionDateTime',
IssuingOrganizationID VARCHAR2(25) PATH 'IssuingOrganizationID',
ReceivingOrganizationID VARCHAR2(25) PATH 'ReceivingOrganizationID',
Version VARCHAR2(50) PATH 'Version',
BillingCategory VARCHAR2(25) PATH 'BillingCategory'
)a;

The problem is that I have no rows returned ! But when I delete the attributes :
xmlns="http://www.IATA.com/IATAAviationInvoiceStandard" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.IATA.com/IATAAviationInvoiceStandard
http://www.iata.org/whatwedo/finance/clearing/sis/Documents/schemas/IATA_IS_XML_Invoice_Standard_V3.0.xsd"

from InvoiceTransmission element, I have all infos that I need.
Can someone please tell me how can I correct my SQL statement to have the same result because I'm not supposed to delete attributes and not supposed to know them.

Thanks for your help.

[Updated on: Fri, 15 October 2010 02:21]

Report message to a moderator

Re: Problem with namespaces in XML [message #479204 is a reply to message #479195] Fri, 15 October 2010 04:34 Go to previous messageGo to next message
_jum
Messages: 577
Registered: February 2008
Senior Member
Can you avoid/remove the line: "<?xml version="1.0" encoding="UTF-8"?>" ?
Re: Problem with namespaces in XML [message #479206 is a reply to message #479204] Fri, 15 October 2010 04:48 Go to previous message
czinsou
Messages: 23
Registered: August 2009
Junior Member
No I can't , it's a file that i can just read to import data.
I also try to remove "<?xml version="1.0" encoding="UTF-8"?>" from the xml but it's still the same .
Maybe I must specify the xml namespaces in my query ?
If yes how can I do that ?
Previous Topic: got LPX-00601: Invalid token while try to read xml
Next Topic: Using global temporary tables with java jdbc
Goto Forum:
  


Current Time: Thu Mar 28 23:50:39 CDT 2024