473,394 Members | 1,765 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,394 software developers and data experts.

Xerces-c / SAX question

Hello,
I have a problem with SAX on Xerces-c. What I want to do for
now is just save the name of each XML element in an array.

So, I've implemented my own startElement method. The problem is
that the startElement method has a parameter whose type is "const
XMLCh * const name". How can I produce a char * from that ?

I tried printing the name parameter but what I got was only the first
character of each node's name. What am I doing wrong ?

Thanks in advance!
--
Papastefanos Serafeim
Jul 6 '06 #1
4 1143


Papastefanos Serafeim wrote:

So, I've implemented my own startElement method. The problem is
that the startElement method has a parameter whose type is "const
XMLCh * const name". How can I produce a char * from that ?
To support Unicode (which XML requires) char * would not suffice. There
is a Xerces-C user mailing list I think where you have more chances to
find someone familiar with the Xerces API.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 6 '06 #2
Papastefanos Serafeim wrote:
that the startElement method has a parameter whose type is "const
XMLCh * const name". How can I produce a char * from that ?
XMLch is used because SAX wants to return UTF-16 characters. Looking at
the examples on Apache's website, it looks like you can invoke
XMLString::transcode to obtain a char*; it's your responsibility to
release it after you're done with it.

Examples and programming guides can be found at
http://xml.apache.org/xerces-c/apiDocs/index.html
Jul 6 '06 #3
Thanks for the answers.
XMLString::transcode() was just fine :)

--
Papastefanos Serafeim

? "Joe Kesselman" ?????? ??? ?????? news:44********@news.greennet.net...
Papastefanos Serafeim wrote:
>that the startElement method has a parameter whose type is "const
XMLCh * const name". How can I produce a char * from that ?

XMLch is used because SAX wants to return UTF-16 characters. Looking at
the examples on Apache's website, it looks like you can invoke
XMLString::transcode to obtain a char*; it's your responsibility to
release it after you're done with it.

Examples and programming guides can be found at
http://xml.apache.org/xerces-c/apiDocs/index.html

Jul 7 '06 #4
Serafeim, oxi sta ba8eia paidi mou.
( MANABHS )
http://www.tvradio.web1000.com

( twra exei 7150 radio & TV sta8mous )

Jul 22 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: bugbear | last post by:
Subject pretty much says it all. I'd like to parse XML (duh!) using Xerces (because its fast, and reliable, and comprehensive, and supports lots of features). I'd like to conform to standards...
1
by: Stu | last post by:
I am trying to build the xerces shared library with 2.3.0 version of their source code on an AIX 5.1 32 bit machine with the following version of the g++ compiler /usr/local/bin/g++ -v Reading...
0
by: Waseem | last post by:
Hi I have looked and tried everything and i still cant sort this out i have no idea why this wont work I am using Xerces Perl on Windows and Debian to try this and it wont work on both of...
4
by: joes | last post by:
Hello there I tried for several days to get a simple validation with xml schema & xerces working. Goal for me is tuse JAXP and not specific Xerces classes. I don't get the point what I am doing...
0
by: Jim Phelps | last post by:
After having memory leak issues with Xerces-c 2.3.0 for Solaris 2.7 for CC 6.2 I have decided to update to at least 2.4. I have downloaded the binary tarball and have installed it on my...
0
by: Dale Gerdemann | last post by:
I've been trying to use DOM level 3 with xerces-2_6_2. There's a sample called samples/DOM3.java, but I've had trouble with compilation. I've downloaded Xerces-J-bin.2.6.2 and...
2
by: Cigdem | last post by:
Hello, I am trying to parse the XML files that the user selects(XML files are on anoher OS400 system called "wkdis3"). But i am permenantly getting that error: Directory0: \\wkdis3\ROOT\home...
18
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);...
2
by: Vlad Zorinov | last post by:
I'm getting the following error after a couple of months of XML processing, using Xerces 2.0.0 in an apache tomcat. Does anyone have any ideas what this problem may be or what I should do to solve...
9
by: mstilli | last post by:
Hi, I am trying to use schema for server side validation using xerces to catch the validation errors. validating this XML: <Content4> <textarea13></textarea13>...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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
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
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...

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.