Solved

Parsing an xml file that is not valid nor well formed

Posted on 2008-10-22
4
290 Views
Last Modified: 2013-11-11
Hello,
I was hoping to use the available tools for parsing XML files, but it turns out that the xml files I have to work with are not valid nor are they well formed.
Might anyone have sample code (example) as to how I could start parsing.  I know that I will have to strip away several lines from the top, then throw it into some Hash map.
Any other suggestions?
0
Comment
Question by:chima
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 

Author Comment

by:chima
ID: 22778733
I later found information about XPath.  My additional question is; Does XPath work with xml files that are not well formed, not valid?
0
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 22779077
No, XPath only works on wellformed XML.
There are tools that use XPath-like expressions on other types of data (such as reletional database tables, or spreadsheet objects,
but that is because they internally map the data object to XML before releasing the XPath over it.

I assume this answers the additional question.

I have given you some hints on how to solve the original question in your other (equal) question.
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/XML/Q_23837605.html
Lets deal with that issue there, not to have two parallel threads
You should not post the same question twice.
0
 

Author Closing Comment

by:chima
ID: 31508845
I agree on not having two postings, but I wanted this question to go to the XPath experts.  I could not see how to add a Zone to the existing questions.
thanks
0
 
LVL 60

Expert Comment

by:Geert Bormans
ID: 22779685
welcome
0

Featured Post

How To Install Bash on Windows 10

Windows’ budding partnership with Canonical has certainly led to some great improvements. One of them being the ability to use Bash on your Windows machine without third party applications! This might be one of the greatest things a cloud engineer in a Windows environment can do!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Browsing the questions asked to the Experts of this forum, you will be amazed to see how many times people are headaching about monster regular expressions (regex) to select that specific part of some HTML or XML file they want to extract. The examp…
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

623 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