NetTalk Central
Toggle navigation
Login
Register
×
Welcome,Guest
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
NetTalk Central
»
NetTalk Web Server
»
Web Server - Ask For Help
»
xHTML to Text
« previous
next »
Print
Pages: [
1
]
Author
Topic: xHTML to Text (Read 7547 times)
broche
Sr. Member
Posts: 336
xHTML to Text
«
on:
February 08, 2016, 10:03:29 AM »
Hi,
NT9.05 Apps
Cl 10
I need to convert an xHTML field to Text to include in an email body.
Any ideas?
Brian
Logged
Brian
kevin plummer
Hero Member
Posts: 1195
Re: xHTML to Text
«
Reply #1 on:
February 08, 2016, 11:05:59 PM »
string theory?
Logged
broche
Sr. Member
Posts: 336
Re: xHTML to Text
«
Reply #2 on:
February 09, 2016, 07:55:43 AM »
Looked at String Theory but not sure I understand it if it is there?
Logged
Brian
broche
Sr. Member
Posts: 336
Re: xHTML to Text
«
Reply #3 on:
February 09, 2016, 07:56:37 AM »
For now I moved all fields back to plain text so I don't have this issue.
Thanks.
Logged
Brian
kevin plummer
Hero Member
Posts: 1195
Re: xHTML to Text
«
Reply #4 on:
February 09, 2016, 02:19:09 PM »
I was thinking you could use ST to remove all tags and convert some to cr\lf etc to automatically translate from xhtml to plain text.
Logged
broche
Sr. Member
Posts: 336
Re: xHTML to Text
«
Reply #5 on:
February 10, 2016, 12:07:04 AM »
Thanks, yes I looked at doing that. My limitation is knowing all the tags I suppose.
I will tackle this in my test environment as I like the xHTML look for the text fields for my customers.
Logged
Brian
kevin plummer
Hero Member
Posts: 1195
Re: xHTML to Text
«
Reply #6 on:
February 10, 2016, 02:05:17 PM »
check out remove in ST it might do the trick.
Logged
Bruce
Global Moderator
Hero Member
Posts: 11297
Re: xHTML to Text
«
Reply #7 on:
February 14, 2016, 11:00:38 PM »
see RemoveAttributes
http://www.capesoft.com/docs/StringTheory/StringTheory.htm#stRemoveAttributes
That cleans it up a bit. Then Replace to replace some tags with text - for example replacing <br> or <br/> or <p> with CR/LF (ie '<13,10>')
Then other tags need replacing as well, some requiring some thought, especially <ol> and <ul> (ordered and unordered lists), tables and so on.
Cheers
Bruce
Logged
Print
Pages: [
1
]
« previous
next »
NetTalk Central
»
NetTalk Web Server
»
Web Server - Ask For Help
»
xHTML to Text