?
Solved

HTML Page to XML

Posted on 2011-03-17
8
Medium Priority
?
282 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
[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
8 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 1500 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 75

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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 75

Expert Comment

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

Well-formed HTML is a subset of XML  :  )
0
 
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 75

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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

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

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Suggested Courses
Course of the Month10 days, 17 hours left to enroll

770 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