Solved

HTML Page to XML

Posted on 2011-03-17
8
268 Views
Last Modified: 2012-05-11
How can we Convert HTML to XML

i want to save this xml to SQL Database

Thanks
0
Comment
Question by:Kalpesh Chhatrala
8 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 500 total points
ID: 35156657
Exactly what XML format are you looking for? Do you want to convert that HTML document to an XHTML document? SgmlReader can help doing that, http://developer.mindtouch.com/en/docs/SgmlReader

Convert HTML to XHTML and clean unnecessary tags and attributes / Utilities / C#
http://netcode.ru/dotnet/?lang=&katID=30&skatID=281&artID=7730
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 35156667
You HAVE to ensure the HTML is well-formed (as in XML well-formed). Other than that, it should just be a matter of having an XML-typed column in your database and inserting the data.

If you cannot guarantee that your HTML is well-formed, then you will not be able to store this data.
0
 
LVL 3

Expert Comment

by:CombatGold1
ID: 35156678
I think you've misunderstood what XML is. HTML is mark-up for both presentation and data/content whereas XML is mark-up specifically for data/content only, it has no presentation information.

Essentially they are formatted very similar so they shouldn't need much conversion, though I'm still unsure why you would need to convert HTML to XML to store it in an SQL database.

Could you possibly show us the HTML you want converted (or a portion of it) and why you need it in XML?
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 35156790
@CombatGold1

Well-formed HTML is a subset of XML  :  )
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 23

Expert Comment

by:wdosanjos
ID: 35157912
My 2 cents... I'm not sure what's your specific need, but I think it would be simpler to store the HTML in a nvarchar(max) column.

Can you elaborate on why you need it to be in XML?
0
 
LVL 16

Author Comment

by:Kalpesh Chhatrala
ID: 35158525
i want to save html data column by column into SQL Server.

i attached here with html page sample

html-page.htm
0
 
LVL 74

Expert Comment

by:käµfm³d 👽
ID: 35160066
Your attached example is not well-formed XML. You will need to either correct it if you want to store it in an XML-typed column, or store it in a string-typed column.
0
 
LVL 16

Author Closing Comment

by:Kalpesh Chhatrala
ID: 35163802
Partially helpful.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

747 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

10 Experts available now in Live!

Get 1:1 Help Now