Solved

HTML Page to XML

Posted on 2011-03-17
8
280 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 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 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
How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

 
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

Industry Leaders: 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!

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…
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…

707 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