Convert text to HTML for use in XML

exAHSacto

New Member
Joined
Oct 4, 2011
Messages
38
Hi all,

I really hope you can help me on this one.

I need to convert plain text to HTML language, so I can use it in a XML file. In other words I need to insert a lot of "< /b</B>", etc.

I have the text in Word atm, but I can move it to Excel, if that should help.

If I save the document as a web page, then the HTML code contains a lot of noice. Here is an example:

HTML:
<p class=MsoNormal><b style='mso-bidi-font-weight:normal'><span lang=DA
style='mso-ansi-language:DA'>Det her skal virke<o:p></o:p></span></b></p>

I have tried using online converters, but that is not a viable solution.

best regards
Anders
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes
Hi,
Simply saving as webpage would be the easiest, otherwise you need to add the tags and make a new html file etc etc. would take some doing esp if the user can change formatting
 
Upvote 0
is this text only going to be a particular area as in a < p> tag and always the same font and size and style?
 
Upvote 0
Why convert to HTML and then to XML?

What about converting straight to XML?
 
Upvote 0
Anders

Do you have a specific schema you need to use when converting to XML?

Also what format is the data currently in?

Is it just a text file?
 
Upvote 0
Norie! :)

No I'm not using schemas, since I don't know how they work.

I'm creating an XML file in VBA for XBRL use. I need to convert several rows to XML-code.

I loop through several cells testing if they are bold, empty and so on.

HTML:
For r = 1 To myRows
                    If Range("rng_man_rev").Offset(r, 0).Font.Bold = True Then
                        Print #1, myPara & "" & Range("rng_man_rev").Offset(r, 0).Text & "
"
                    End If
                    If Range("rng_man_rev").Offset(r, 0).Font.Bold = False And Range("rng_man_rev").Offset(r, 0).Value <> "" Then
                        Print #1, myPara & Range("rng_man_rev").Offset(r, 0).Text & "
"
                    End If
                    If Range("rng_man_rev").Offset(r, 0).Value = "" Then
                        Print #1, "
"
                    End If
                Next r


Do you know a better way to do it?

/Anders
 
Upvote 0
Anders

XBRL uses similar syntax to XML but it's not quite the same.

Have you searched for Excel to XBRL conversion applications?

There are definitely some out there, even some free ones.

How good they are I couldn't tell you but they might be worth a look.:)
 
Upvote 0

Forum statistics

Threads
1,215,436
Messages
6,124,867
Members
449,192
Latest member
MoonDancer

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top