473,388 Members | 1,330 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,388 software developers and data experts.

html in xml, php & flash

hello,

is there an official or a correct way for the following problem:

in my xml file, there is also html text. this xml file is used in flash and a php code.
the problem is, that - using simplexml in php - the html-tags are interpreted as xml-tags and it gets difficult to use the content. if i use &gt and &lt instead of < and or place the html-text in a CDATA, flash doesnt display the text as html and also returns errors. is it common at all, to place html into an xml-file?

a simple example of the xml-file:
----------------------------------
<?xml version='1.0' encoding='utf-8'?
<website
<site title="Titel"
<text><p>lalala <b>tada</b<font color="#ff0000">dings
</font></pand a <a href="blabla.html" target="_blank"
link</a><img src="bild.jpg"/></text
</site
</website
----------------------------------

i already have some methods of resolution to solve the problem:
- modify the html tags in the php code, so simplexml does not recognize them as xml-tags
- replace/delete the &lt and &gt or cdata by string operator in flash
- code own php script to put the xml into a php array

the point is that i want to do it correctly, use a "clean" (and perhaps not pedestrian) way so i will not have any unconsidered problems afterwards. perhaps you could suggest how to do it best - it would be great, thank you!
Sep 17 '06 #1
1 2892
Rebecca Tsukalas wrote:
>
i already have some methods of resolution to solve the problem:
- modify the html tags in the php code, so simplexml does not recognize
them as xml-tags - replace/delete the &lt and &gt or cdata by string
operator in flash - code own php script to put the xml into a php array
I guess the question is really this: Is the HTML always atomic wrt the XML -
in which case it doesn't matter.

The CDATA thing will work as long as you don't have CDATA encolsures within
your html. Personally, I would go for base64 encoding the html and
including the encoding mechanism in the markup - that should be less of an
overhead than the string replace method and (IIRC) the HTML can be
reconstructred by XSLT.

Of course, if you're HTML is not atomic with regard to the XML, then you've
got quite a different problem.

HTH

C.

Sep 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Donald Tyler | last post by:
Yes it can. But you should understand the three distinct levels of that situation. You need the following: Database Web Server Server-Side Scripting Language I would suggest using AMP...
0
by: Matt | last post by:
Hello, I am attempting to get a software prototype UI/demo built in Flash to talk with existing C++ (so I can exchange data and commands between the application-software already developed in the...
72
by: Paminu | last post by:
In math this expression: (a < b) && (b < c) would be described as: a < b < c But why is it that in C these two expressions evaluate to something different for the same values of a, b and...
6
by: Paolo Pignatelli | last post by:
I have an aspx code behind page that goes something like this in the HTML view: <asp:HyperLink id=HyperLink1 runat="server" NavigateUrl='<%#"mailto:" &amp;...
1
by: rajasekar.karthik | last post by:
In inner html we are using a javascript function i want to now how to call this function. <div style='padding-left:130px;' id='bowling'> </div> <div...
10
by: Steve Cook | last post by:
Hi, I have an upload application written in PHP and Flash. The PHP page gets the file information via $_POST. Moreover, the user never actually visits the PHP page, rather Flash sends the...
11
by: emailus | last post by:
I am webmaster for the domain <www.alpha1.org.au>. Not being an expert in html, I take advantage of my domain Registrant's web building tool, 'Instant Website'. This tool is provided as part of...
5
by: smittie31 | last post by:
I am having a problem with a border around me html page. The border does not flow thru the whole html page, it cuts off halfway. --> See http://keithborom.com/marlon-sanders CSS STYLESHEET ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.