Kalpesh Chhatrala
asked on
HTML Page to XML
How can we Convert HTML to XML
i want to save this xml to SQL Database
Thanks
i want to save this xml to SQL Database
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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?
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?
@CombatGold1
Well-formed HTML is a subset of XML : )
Well-formed HTML is a subset of XML : )
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?
Can you elaborate on why you need it to be in XML?
ASKER
i want to save html data column by column into SQL Server.
i attached here with html page sample
html-page.htm
i attached here with html page sample
html-page.htm
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.
ASKER
Partially helpful.
If you cannot guarantee that your HTML is well-formed, then you will not be able to store this data.