Solved

Euro Sign using XML, VB, Java

Posted on 2002-05-20
8
813 Views
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.

regards,
Adam
0
Comment
Question by:adamgernon
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 23

Expert Comment

by:b1xml2
Comment Utility
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"?>
<data>
<chair>
<price xmlns="uri:euro">1.35</price>
<price xmlns="uri:us">2.00</price>
<price xmlns="uri:uk">1.05</price>
</chair>
</data>
0
 
LVL 23

Expert Comment

by:b1xml2
Comment Utility
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 =))
0
 
LVL 7

Expert Comment

by:yoren
Comment Utility
What's the exact error you get from Xerces? Maybe the Euro symbol is not the problem.
0
 

Author Comment

by:adamgernon
Comment Utility
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.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 7

Accepted Solution

by:
yoren earned 100 total points
Comment Utility
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.
0
 
LVL 27

Expert Comment

by:BigRat
Comment Utility
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;
0
 

Author Comment

by:adamgernon
Comment Utility
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.
cheers,
Adam
0
 

Author Comment

by:adamgernon
Comment Utility
request for deletion of queston been here for over a year!!!
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

The Problem How to write an Xquery that works like a SQL outer join, providing placeholders for absent data on the outer side?  I give a bit more background at the end. The situation expressed as relational data Let’s work through this.  I’ve …
Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now