Reply
Cut HTML string without breaking the tags
Old 05-09-2008, 09:00 AM Cut HTML string without breaking the tags
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
Hello i have to cut a html page in 2 or 3 parts. But the problem i have is that i haven't found a way to cut without messing the HTML by cutting between tags.

I have found some code on the net that did such a task but it doesnt go well on every page, if for example is not HTML valid. Plus it didnt have suport for things like ... selects.

I would appreciate if any of you guys know of a method to best cut a html string.
__________________
If you like my posts ... TK is appreciated:)
Web Directory | Blog
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
When You Register, These Ads Go Away!
     
Old 05-09-2008, 11:37 AM Re: Cut HTML string without breaking the tags
JeremyMiller's Avatar
Full-Time TeraTasker

Posts: 953
Name: Jeremy Miller
Location: Reno, NV
May want to try running the code through a cleanup script (like Tidy or the PEAR extension) and then into SimpleXMLElement. Once in the array structure, you can more accurately traverse the text to find areas where you want to split.
__________________
Jeremy Miller - TeraTask Technologies, LLC
Content Farmer - Automated Posting for Content & Blog Sites
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 05-09-2008, 03:00 PM Re: Cut HTML string without breaking the tags
Inet411's Avatar
Skilled Talker

Posts: 82
Name: programmer
Location: internet
Can you post a sample of the html in question.
Inet411 is offline
Reply With Quote
View Public Profile Visit Inet411's homepage!
 
Old 05-09-2008, 03:07 PM Re: Cut HTML string without breaking the tags
solomongaby's Avatar
Webmaster Talker

Latest Blog Post:
How Do You Find Music Online ?
Posts: 522
Name: Gabe Solomon
Location: Romania
finaly found a solution in a cakephp function.
Thank you for all your answers.

I have posted the code in my blog.
__________________
If you like my posts ... TK is appreciated:)
Web Directory | Blog
solomongaby is offline
Reply With Quote
View Public Profile Visit solomongaby's homepage!
 
Reply     « Reply to Cut HTML string without breaking the tags
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12101 seconds with 13 queries