Conversion of XML to ASCII... Easy?
Discussion
dilbert said:
ProPlus said:
How easy for it to do the conversion above??
It could be in JAVA or in C++.
I would prefer to do a JAVA version of it.
XML is usually ASCII.
the xml is coming to us in one format, I then need to convert it to a base version of ASCII so online reports can be produced, without anyone knowing there have been changes.
Still none the wiser.....
Theres an XML parser in one of the standard java libraries, IIRC.
Have a nose through the manual, javax.xml.parsers.
Hope that helps.
Theres an XML parser in one of the standard java libraries, IIRC.
Have a nose through the manual, javax.xml.parsers.
Hope that helps.
ProPlus said:
How easy for it to do the conversion above??
It could be in JAVA or in C++.
I would prefer to do a JAVA version of it.
Your comments don't give much away about the project but it seems that what you're trying to do is deserialize the XML, and then serialize it again in a different format i.e. ASCII...
Depending on how complex the document is it could be something as simple as defining a class that matches the data in the XML doc, deserializing that doc into an object of the defined class, then re-serializing it (presumably with formatting) in ASCII... at least that would be my general approach
I just googled for Java XML reader and got tons of links....
XML documents can be encoded in a number of formats - ascii, UTF-8, UTF-16 etc. Its normally specified in the header. The default is UTF-8, eg.
<?xml version="1.0" encoding="UTF-8" ?>
Sounds like Proplus just wants to convert the whole document to ascii, rather than parse the attributes/tags within it... First you need to find out what encoding your documents are in - they could already be ascii?
<?xml version="1.0" encoding="UTF-8" ?>
Sounds like Proplus just wants to convert the whole document to ascii, rather than parse the attributes/tags within it... First you need to find out what encoding your documents are in - they could already be ascii?
oldskool said:In that case: http://javaalmanac.com/egs/java.nio.c
Sounds like Proplus just wants to convert the whole document to ascii, rather than parse the attributes/tags within it... First you need to find out what encoding your documents are in - they could already be ascii?
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff



