Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 290
  • Last Modified:

xml styles

xml code:
<pageText><![CDATA[
<font color="#ffffff" size= "14px" face="Tahoma">OUR MAIN AIM HERE AT TICKTOCKIT</font><font color="#ffffff" size= "10px" face="Arial"> IS TO PROVIDE IT SUPPORT MAINLY FOR ALL WINDOWS BASED SYSTEMS. WE ALSO DEAL WITH LINUX AND MAC SYSTEMS IN A MORE LIMITED CAPACITY. TO GO STRAIGHT TO SUPPORT, CLICK ON THE SUPPORT MENU ABOVE AND FOLLOW THE INSTRUCTIONS TO ALLOW REMOTE ACCESS TO YOUR SYSTEM. THE CONTACTS MENU ABOVE WILL GIVE YOU FULL DETAILS OF HOW TO CONTACT US TO REQUEST A REMOTE SESSION OR TO ENQUIRE ABOUT / REQUEST OUR SERVICES</font>
--

In the above code I need to be able to change the type face to Arial, Tahoma,, Impact (or whatever face will be accepted) and use Bold (strong ) tags
Is this possible with xml?
Do I need to use css linking - if so how please
0
doctorbill
Asked:
doctorbill
  • 2
1 Solution
 
Geert BormansCommented:
The main question is... how do you use the above XML

The issue is the following. All the HTML is wrapped in a CDATA section. Allthough it looks like HTML, in XML terms the HTML is a a simple text node and "<font" is not the start of a tag but simply a sequence of 4 characters starting with "&lt;"

Simple XML tools can not help you here. If you would use XSLT for instance, the entire pageText element is one giant text node
XSLT3 however has a html-parse function that could make that into genuine xhtml so you could use XPath for addressing and change the values
I know that PHP has a similar function (actually a lot of languages have some sort of wrapper around John Cowans TagSoup parser... google for it if you want the details)

So it all boils down to how you are using the XML

If you control the source XML, you should get rid of the CDATA serialisation and use (namespaced) embedded html. You would have better control then

You could pull out the pageText element content with a getSingleNode and process the text with a html parser function in a language that allows it and pass the node back in as a tree. All depends on how you work around this document

If nothing else is possible, develop some regexes or a text parser to just sneak in the right values. Though task ahead in that case
0
 
doctorbillAuthor Commented:
The code is being used by flash in a website
0
 
doctorbillAuthor Commented:
Possible solution
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now