Solved

Parsing an xml file that is not valid nor well formed

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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Mongodb hierarchy 2 60
Detect file exist or not 3 181
Post xml via PHP Soap Client 3 62
Help needed with Powershell  XML to MySQL 5 62
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…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

821 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