Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Euro Sign using XML, VB, Java

Posted on 2002-05-20
Medium Priority
Last Modified: 2012-06-22
I am using a VB client to pass data to a java servlet which processes the data (passed using MSXML3 on the client to Xerces-1_4_3 on the server) and writes it to an oracle database.  The problem I am having is with the euro symbol (€).   I convert it from € to € using Replace method in VB and then I pass this XML (UTF-16) to the server which is telling me the document is mal formed - Org.sax.parser exception.

I presume that Xerces supports the Euro symbol so I am kinda stuck.

Question by:adamgernon
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
  • +1
LVL 23

Expert Comment

ID: 7021980
The thing is that MSXML3 supports the windows-1252 encoding for which the Euro symbol is supported. I think on principle, you should not worry about the euro symbol per se as it has more to do with the presentation layer than the data layer. You can use namespaces to determine the datatype if you want to get down to partitioning the data. Do not use the symbol to figure out what kind of currency. That is more reserved for display purposes.

for e.g.
<?xml version="1.0" encoding="utf-8"?>
<price xmlns="uri:euro">1.35</price>
<price xmlns="uri:us">2.00</price>
<price xmlns="uri:uk">1.05</price>
LVL 23

Expert Comment

ID: 7021988
in fact, by using namespaces here, it is pretty useful if you are using XSLT to display the data because you can sum prices for objects based on the namespace. in fact, using namespaces here is an excellent choice =))

Expert Comment

ID: 7022086
What's the exact error you get from Xerces? Maybe the Euro symbol is not the problem.
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 7022094
It is definitely the Euro symbol that is causing the problem because when u enter in ascii text and call the server method using POST it succeeds fine however, if I just enter the symbol € it collapses.

Accepted Solution

yoren earned 300 total points
ID: 7022136
The Euro symbol is a valid XML character, and I verified that Xerces 1.4.4 handles it correctly. So, either it's a bug in version 1.4.3 (unlikely), or your document is not well-formed. Are you sure your document is encoded in UTF-16? If it is, are you properly declaring that with <?xml version='1.0' encoding='UTF-16'?> ?

You can probably debug this easier on the command line. Another option is to post your document here; I may be able to spot the problem.
LVL 27

Expert Comment

ID: 7024514
Interestingly enough you have posted your message using hex 80 as the Euro symbol, yet you wish to use 8364 = hex 20AC which of course is the offical Unicode sign.

There are two cases :-

a) The insertion/substitution of the sign with the entity is incorrect so that the parser reports an error

b) hex 20AC is not a valid character since the parser supports only Unicode versio 2.0 (the 20AC came later).

I suspect a) is true. Try subsituting &#36; (which is dollar) instead just to check that you get the entity substitution correct. If that works try using &#128;

Author Comment

ID: 7043928
I have figured out that the problem is that on the client we are encoding using UTF-16 but on the Java Server where we are using Xerces DOM implementation I cannot manage to get the encoding to UTF-16. See my other question posted 05/28/2002.  Anyway, let me know if u can solve this little conundrum.

Author Comment

ID: 10152406
request for deletion of queston been here for over a year!!!

Featured Post

Cloud Training Guides

FREE GUIDES: In-depth and hand-crafted Linux, AWS, OpenStack, DevOps, Azure, and Cloud training guides created by Linux Academy instructors and the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question