Solved

xml styles

Posted on 2014-04-14
3
276 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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
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…

757 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now