|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Saving article text to XML format
I need to save text to XML for retrieving later. I can either parse the text area form text on chr(13) and chr(10) and insert the proper tags and later loop through the XML to display them or I can encode the text as a binary object and later decode to a string which will retain all of the breaks etc. The second seems easier but your content is now in a cryptic format that may not be as easily indexable for search. What are my options here to encode to XML but not lose the breaks?
Thanks! Ed |
|
#2
|
|||
|
|||
|
You could look into XSLT but if you're starting with plain text that might not work. The answer really depends on what you're starting with and what you need to end up with. Is the final XML simple or complex? Is it nested? Are there attributes? Etc.
Your approach of replacing chr(13) & chr(10) with basic XML would work fine if that's all you need. I'd avoid encoding it all as binary for the reasons you described.
__________________
Ask if you have a question, but also help answer questions that you have knowledge of! Thanks, Brian. How to Post a Question in the Forums |
|
#3
|
|||
|
|||
|
It's pretty basic. I am using a text area element in a form to input the contents of a magzine article into a content management system of sorts. All the attributes of the article title, author, etc are all XML tags and some do have attributes. The problem comes if I just enter the body of the article through the form and it loses all paragraph formatting.
Thanks for the input! ED |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Saving article text to XML format |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|