473,498 Members | 2,021 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Creating XML in Java with a namespace.

56 New Member
I am creating an XML String with the

Expand|Select|Wrap|Line Numbers
  1.  
  2. private String sTradeSizeXML = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
  3.     "<xsl:stylesheet version=\"1.0\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\">" + "  " +
  4.     "xmlns:i=\"http://www.abc.com/common/interests:i\">" +
  5.     "<Note>" +
  6.     "<i:Level>100000</i:Level>"     +
  7.     "<i:Size>20000</i:Size>"        +
  8.     "</Note>"                  +
  9.     "</xsl:stylesheet>";   
  10.  
  11.  
  12. On execution,it gives me the error:
  13.  
  14. Fatal Error] :1:183: The prefix "i" for element "i:Level" is not bound.
  15. org.xml.sax.SAXParseException: The prefix "i" for element "i:Level" is not bound.
  16.  
  17.  
But I am binding this to i: in the above string ?
So why is it still giving that error?
Jun 8 '07 #1
1 1743
dorinbogdan
839 Recognized Expert Contributor
You must declare the namespace in Java before using it.
See this link.
Jun 8 '07 #2

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

Similar topics

0
6783
by: Ravi Tallury | last post by:
Hi We are having issues with our application, certain portions of it stop responding while the rest of the application is fine. I am attaching the Java Core dump. If someone can let me know what...
8
9075
by: Simon Edwards | last post by:
Something thats been bugging me for a while... how do you create a namespace that has many children (namespaces) I.e system.io.blah.blah Iv'e done it by creating a class which contains...
7
4957
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type...
2
2728
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects"...
0
1029
by: Mikaelo | last post by:
Hello! I have small problem. Thera are web-service in java, it has method "getTestUrl" wsdl for it <wsdl:operation name="getTestURL"> <wsdlsoap:operation soapAction=""/> <wsdl:input...
18
7700
by: jacksu | last post by:
I have a simple program to run xpath with xerces 1_2_7 XPathFactory factory = XPathFactory.newInstance(); XPath xPath = factory.newXPath(); XPathExpression xp = xPath.compile(strXpr);...
16
2331
by: tshad | last post by:
This is a little complicated to explain but I have some web services on a machine that work great. The problem is that I have run into a situation where I need to set up my program to access one...
1
1634
by: Vishuonline | last post by:
Guys, I have had some experience in working with webservices created in .NET but this is the first time I am trying out one made in Java. When I run the wsdl exe to create a proxy class for...
23
2414
by: Martin Pöpping | last post by:
Hello, I´m relatively new in programming with C#. I want to design a class with can only be used in the same namespace. So I declared this class as protected, but the compiler gives me the...
0
1090
by: Douglas Zuniga | last post by:
First at al Hi. I'm having some problems trying to connect my C# program-classes to Java, I've been reading about it and I found this:...
0
7121
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
6993
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
7162
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
6881
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...
1
4899
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
650
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
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.