473,386 Members | 1,821 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Namespace prefix used but not declared

Hi All,

I am trying to parse the xml.

<ns1:ProcessGLAccountValidationRequestABM xmlns:ns1="http://xmins.oracle.com/ApplicationObjects/Ebiz/Core/ABM/ChartOfAccounts/V1">
<ns2:ChartOfAccountsName xmlns:ns2="http://xmlns.oracle.com/ApplicationObjects/Ebiz/Core/ABO/ChartOfAccounts/V1">Netherlands Accounting Flex</ns2:ChartOfAccountsName>
<ns2:ChartOfAccountsId>50560</ns2:ChartOfAccountsId>
<ns2:CodeCombinations>
<ns2:CodeCombinationId>76589</ns2:CodeCombinationId>
<ns2:GLElementValueList>
<ns2:ValueSetName>SEGMENT1</ns2:ValueSetName>
<ns2:Value>04</ns2:Value>
</ns2:GLElementValueList>
<ns2:GLElementValueList>
<ns2:ValueSetName>SEGMENT2</ns2:ValueSetName>
<ns2:Value>7410</ns2:Value>
</ns2:GLElementValueList>
<ns2:GLElementValueList>
<ns2:ValueSetName>SEGMENT3</ns2:ValueSetName>
<ns2:Value>320</ns2:Value>
</ns2:GLElementValueList>
<ns2:GLElementValueList>
<ns2:ValueSetName>SEGMENT4</ns2:ValueSetName>
<ns2:Value>000</ns2:Value>
</ns2:GLElementValueList>
</ns2:CodeCombinations>
</ns1:ProcessGLAccountValidationRequestABM>

but when i tried it is throwing error,

Exception occured in ValidateCCIDProcess.process() :oracle.xml.parser.v2.XMLParseException: Namespace prefix 'ns2' used but not declared.
oracle.xml.parser.v2.XMLParseException: Namespace prefix 'ns2' used but not declared.

Please help me.
--------------------

thanks & regards,
Rakesh.
Sep 5 '08 #1
2 14326
Dormilich
8,658 Expert Mod 8TB
Hi,

all namespaces must be declared in the root element.

regards
Sep 5 '08 #2
jkmyoung
2,057 Expert 2GB
I agree, move the namespace declaration to the root.

More detailed explanation:
The namespace doesn't have to be declared in the root node; however, each namespace declaration is only good for the element it is in, and all descendants of that node.

Expand|Select|Wrap|Line Numbers
  1. <ns2:ChartOfAccountsName xmlns:ns2="http://xmlns.oracle.com/ApplicationObjects/Ebiz/Core/ABO/ChartOfAccounts/V1">Netherlands Accounting Flex</ns2:ChartOfAccountsName> 
  2. <ns2:ChartOfAccountsId>50560</ns2:ChartOfAccountsId> 
  3.  
The ns2 namespace only lasts within the ns2:ChartOfAccountsName here.
ns2:ChartOfAccountsId can not find this namespace in any of its ancestors (parent node, or parent's parent, etc..)

You could also make the xml valid by redeclaring the namespace wherever you need to, as below, but that gets messy quickly.
Expand|Select|Wrap|Line Numbers
  1. <ns2:ChartOfAccountsName xmlns:ns2="http://xmlns.oracle.com/ApplicationObjects/Ebiz/Core/ABO/ChartOfAccounts/V1">Netherlands Accounting Flex</ns2:ChartOfAccountsName> 
  2. <ns2:ChartOfAccountsId xmlns:ns2="http://xmlns.oracle.com/ApplicationObjects/Ebiz/Core/ABO/ChartOfAccounts/V1">50560</ns2:ChartOfAccountsId> 
  3.  
Sep 8 '08 #3

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

Similar topics

1
by: Romeo Disca | last post by:
Hello newsgroup, i'm new to xml - what's wrong with this piece code here? i have these two files: test.xml ---- <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE a SYSTEM "test.ent"
2
by: Frank Wilson | last post by:
Is there a way to change the namespace prefix of a document? I am sending a document to an application that requires that every element be prefixed with "sm". My inbound document has every...
2
by: Dale Anderson | last post by:
I have a schema that I'm trying to read. The schema has an element named 'GrantApplication' and one with a namespace prefix named 'SF424:GrantApplication'. When I try to read this schema in, I...
4
by: jb | last post by:
I have discovered that when the WSDL is auto-generated in .NET (i.e. http://.../MyService.asmx?WSDL): * Prior to SP1, it generated xmlns:s0="http://mynamespace/" in <wsdl:definitions>, and then...
3
by: Andy Fish | last post by:
Hi, I am creating a new XmlDocument from scratch, but I can't see how I can make a namespace declaration and associate a prefix with it. For instance in the following example: XmlDocument doc...
2
by: james.cssa | last post by:
I want to declare namespace prefix in the Envelope element (i.e. xmlns:xsi and xmlns:xsd) so that the document will be serialized to look like the following. However, I don't know the right way to...
1
by: Tanja Schaettler | last post by:
Hello! I have an existing SOAP message which looks like: <?xml version="1.0" encoding="UTF-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"...
2
by: scottpet | last post by:
Hi, I want to add a namespace prefix to the root node of an object I am serializing to XML. I have been reading though this article:...
3
by: Markus Bauer | last post by:
Hello, I have a problem with the namespace prefix. I need to add nodes to a xml file that is not created by me. It has a namespace with the prefix "NFD". So an already existing node looks...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.