Solved

xml styles

Posted on 2014-04-14
3
280 Views
Last Modified: 2014-04-16
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
Comment
Question by:doctorbill
  • 2
3 Comments
 
LVL 60

Accepted Solution

by:
Geert Bormans earned 500 total points
ID: 40000188
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
 

Author Comment

by:doctorbill
ID: 40001258
The code is being used by flash in a website
0
 

Author Closing Comment

by:doctorbill
ID: 40004710
Possible solution
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Show tab when enter div and change underline color 3 64
Diminish Pop-up  in 3 seconds 7 49
Asp in server side with Mssql Server 7 4 27
Add to XML (Powershell) 1 30
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question