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

Parsing all XML files with Xerces J

Hi, I want to open XML files, also non well formed ones, to show the XML tags into my java application.
Actually I'm using Xerces2-J to parse XML files, but if I try to open a non-well formed file, the parser throws the SaxException.
How can I open this files?
Thanks
Sep 15 '08 #1
2 1507
JosAH
11,448 Expert 8TB
Hi, I want to open XML files, also non well formed ones, to show the XML tags into my java application.
Actually I'm using Xerces2-J to parse XML files, but if I try to open a non-well formed file, the parser throws the SaxException.
How can I open this files?
Thanks
Well, "non-well formed" xml simply isn't xml. Compare a Java source text that
contains syntax errors; it isn't Java and there is (almost) nothing you can do
about it. You can parse the "non-well formed" xml text until it doesn't make sense
anymore; you even don't know what to do at that point: e.g. insert a correct token
or adjust the current token or just delete it. "non-well formed" is just a euphemism
for "it isn't"; it takes a human to decide how to correct that text; computers aren't
of much help here.

kind regards,

Jos
Sep 15 '08 #2
Nepomuk
3,112 Expert 2GB
If it's some kind of XML viewer or editor you're writing, you'll have to find a way around parsing them with Xerces, just handle them as text files for instance. (You can still try to validate them with Xerces of course.) Then, you'll have to filter and parse the stuff yourself. I can't see any simpler way to solve this, sorry.

Greetings,
Nepomuk
Sep 16 '08 #3

Sign in to post your reply or Sign up for a free account.

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...
0
by: Ewan B | last post by:
Hi, I'm using Xerces to parse XML files using SAX2, and am wondering if there is any information as to what exceptions are being thrown when certain validation errors occur. Taking a simple...
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...
3
by: Girish | last post by:
Hi All, I have written a component(ATL COM) that wraps Xerces C++ parser. I am firing necessary events for each of the notifications that I have handled for the Content and Error handler. The...
3
by: David Svoboda | last post by:
I have a server program that takes commands and acts on them. The server program can also take these commands from an input file or standard input (mainly for testing purposes). As such, I often...
8
by: pradeepsarathy | last post by:
Hi all, Does the SAX parser has eventhandlers for parsing xml schema. Can we parse the xml schema the same way as we parse the xml document using SAX Parser. Thanks in advance. -pradeep
3
by: gatorbeaver | last post by:
I am trying to upgrade an application that is currently using Xerces and is only parsing XML files that are on the local host. I want to add the ability to parse XML files that are located on a...
1
by: christian.eickhoff | last post by:
Hi, I have a general question regarding the parsing of XSD files, referenced within the namespace using Apache Xerces 2.7.0 (CDT). My current c++ application can parse and validate an XML file...
24
by: Marc Dubois | last post by:
hi, is it possible to parse an XML file in C so that i can fulfill these requirements : 1) replace all "<" and ">" signs inside the body of tag by a space, e.g. : Example 1: <fooblabla < bla...
1
by: Sidhartha | last post by:
Hi, I am facing a problem while parsing local language characters using sax parser. We use DOM to parse and SAX to read the source. But when our application parses strings with local language...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.