View Full Version : Xml + Html
RvGaTe
July 8th, 2003, 01:05 PM
with my new flash portfolio, i use xml files to store my text,
but, when i use html inside the xml file, like b i u" etc
it gives an error in the xplorer, wich is clear by me, becoz xml uses the same kind of tags en closes them the same way...
so how is it possible to save html text inside an xml node... ?
<xmlfile>
<text>How doz <b>this</b> works ?</text>
</xmlfile>
like that... ?
RvGaTe
July 8th, 2003, 01:13 PM
just found out that the normal B U and I do work.. but i cant use the BR coz it dozn't close it...
RvGaTe
July 9th, 2003, 01:14 PM
how can i use the html break code in an xml node ?
<xmlfile>
<text>How doz <br/>this<br/> works ?</text>
</xmlfile>
RvGaTe
July 16th, 2003, 06:38 PM
anyone ? plz...
lostinbeta
July 16th, 2003, 06:44 PM
I've never tried so I am not sure, but I think a br tag would be something like this <BR /> At least that is how it is in XHTML :x
villek
August 6th, 2003, 01:30 PM
one time I soved that by pressin' enter when editing the xml:)
<news>
<item1>these are my news.
Check 'em out!</item1>
</news>
When I loaded that into flash, it worked fine, printing the linebreaks.
If you're editing your XML with a cms -app of your own through a server-side language then I can't help.
sry:(
HipHop
August 6th, 2003, 02:05 PM
Originally posted by RvGaTe
how can i use the html break code in an xml node ?
<xmlfile>
<text>How doz <br/>this<br/> works ?</text>
</xmlfile>
How can u use them? im not to sure i do not use XML, but to put you on the right tracks:
its < br > and not < br/ > as you have displayed it, in normal html you code would look like this
(of course take the spaces out after < and before >)
How doz
this
works?
thats if you used the correct < br > tags...
RvGaTe
August 6th, 2003, 03:33 PM
ok, thats 1 problem solved, but what if i want to use the < b > and < u > and < i > tags.... those dont work in xml without getting xtra nodes
how can this be solved... ?
RvGaTe
September 12th, 2003, 05:05 AM
i found the solution, every text i want to put inside the xml, need to be encoded with htmlspecialchar or something (out of my head)
there for, the xml file itself will read normal without gettting errors, but it displays the tags etc,
when importing it into flash it will also show the tags (yes, html=true) therefor i need to double decode it in flash with 2 textfield on the stage
this is the result, lets say i want to import "Hello":
XML file
<xml>
<node><b>Hello</b></node>
</xml>
then, when imported it will display this on the first textfield with html true
<b>Hello</b>
then, when converting the .text to an other textfield with
field2.htmlText = field1.text
wich will convert the TEXT from field 1 to an html enabled textfield wich will show up
Hello
easy as that ;)
Jubba
September 12th, 2003, 08:26 AM
actually, you should use a sever-side script to read, parse and format the XML. I have a PHP tutorial on it coming out pretty soon.
Jubba
September 12th, 2003, 08:38 AM
actually if you are interested here are my files right now. They aren't commented but if you know any PHP you should be able to figure it out. Any questions just ask.
Link: http://reqkills.com/xml/xml-test.zip
RvGaTe
September 12th, 2003, 01:05 PM
that was my perpose, but first i need to be sure it works before combining it with php and mysql...
El Phantom
September 12th, 2003, 02:20 PM
gonna go through Jubba's stuff.
You are awesome man.
--EP
ashanchan
January 10th, 2005, 12:32 AM
Hi dude,
You can embedd html tags inside xml with special xml tag :
<value><![CDATA[<B>Help</B><br><br>This is new line]]></value>
Cheers :)
vincentFX
July 5th, 2005, 05:11 AM
RvGaTe a lot of thanks for your answer, it worked perfect for my needs.
Thanks a lot! :beam:
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.