Solved

Parsing an xml file that is not valid nor well formed

Posted on 2008-10-22
4
283 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
  • 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 run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now