Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Determine encoding of XML file with xerces-c and SAXParser

Reply
Thread Tools

Determine encoding of XML file with xerces-c and SAXParser

 
 
christian.eickhoff@nt.uni-saarland.de
Guest
Posts: n/a
 
      01-24-2007
Hello Everyone,

I am facing a problem which should be relatively easy to solve for XML
or XERCES experts. I am parsing my XML instance using xerces-c
SAXParser. For internal purposes, it is essential to determine the
charset encoding which is usually indentified within the header of the
XML file e.g. <?xml version="1.0" encoding="UTF-8" ?>
After a query in the xerces-c API documentation I guess that:

- XMLDecl(const XMLCh *const versionStr, const XMLCh *const
encodingStr, const XMLCh *const standaloneStr, const XMLCh *const
actualEncodingStr)

should be the right method to detect the according encoding scheme.
After desperate tries to implement this function, I would like to ask
whether somebody has example code in c++ for me as I am almost about to
faint.. Should be very easy actually but maybe I am just not clever
enough to solve myself.. =((

Every code snippet is highly appreciated!!!!

Thanks in advance,
Chris

 
Reply With Quote
 
 
 
 
Magnus Henriksson
Guest
Posts: n/a
 
      01-25-2007
http://www.velocityreviews.com/forums/(E-Mail Removed)-saarland.de wrote:
> Hello Everyone,
>
> I am facing a problem which should be relatively easy to solve for XML
> or XERCES experts. I am parsing my XML instance using xerces-c
> SAXParser. For internal purposes, it is essential to determine the
> charset encoding which is usually indentified within the header of the
> XML file e.g. <?xml version="1.0" encoding="UTF-8" ?>


getEncoding()




// Magnus
 
Reply With Quote
 
 
 
 
Magnus Henriksson
Guest
Posts: n/a
 
      01-25-2007
Magnus Henriksson wrote:
> (E-Mail Removed)-saarland.de wrote:
>> Hello Everyone,
>>
>> I am facing a problem which should be relatively easy to solve for XML
>> or XERCES experts. I am parsing my XML instance using xerces-c
>> SAXParser. For internal purposes, it is essential to determine the
>> charset encoding which is usually indentified within the header of the
>> XML file e.g. <?xml version="1.0" encoding="UTF-8" ?>

>
> getEncoding()
>


Sorry, upon further inspection it turns out that this does not work the
same as it does in Java (which I assumed). Can't help you...


// Magnus
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SAXParser inner XML of entity Mize-ze Java 2 07-12-2007 01:29 PM
Problems with SAX parser in Java (SAX2 driver class javax.xml.parsers.SAXParser found but cannot be loaded) Per Magnus L?vold Java 0 11-16-2004 04:02 PM
Print XML parsing to JspWriter (out) Class org.xml.sax.helpers.NewInstance can not access a member of class javax.xml.parsers.SAXParser with modifiers "protected" Per Magnus L?vold Java 0 11-15-2004 02:27 PM
Unicode and SAXParser Bobo XML 3 12-06-2003 05:27 PM
SAXParser and preserving special characters User XML 0 10-31-2003 07:01 AM



Advertisments