Solved

Parsing an xml file that is not valid nor well formed

Posted on 2008-10-22
4
289 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

710 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