Solved

xml styles

Posted on 2014-04-14
3
283 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

635 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