473,666 Members | 2,143 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Any suggestions CSS/XML

I have an interesting implementation and I am trying to kill two birds with
one stone. In the wizard I am designing the user has the ability to choose
from one of n CSS style sheets to be applied to the end results of the
wizard. I am also thinking of supporting customization of the stylesheet
and this is where my question comes in. I have been commenting my
stylesheets using xml as a guide, for example

<data>
<name>Cool Blue</name>
<comment>yadd a</comment>
<styleset name="common">
<styles>
<style name="gridTitle ">This style is used to etc...</style>
<style name="gridBody" >this style is....</style>
</styles>
<raw>
dummy{}
.gridTitle{font-size:10pt;color :red}
.gridBody{fonts-size:8pt;color: black}
</raw>
</styleset>
...more styleset nodes
</data>
You will notice that the actual styles are contained in the node raw. I have
found that if a create a dummy() empty style the following styles are
correctly picked up by the css parser on all modern browsers!!

So even though this xml/css crossbreed seems to work I wonder if there is a
set way of doing this that I am unaware of. I have done some research but
have not found anything so though I would ask all you smart people.

Cheers
Keith
Nov 12 '05 #1
4 1101


Keith Chadwick wrote:
I have an interesting implementation and I am trying to kill two birds with
one stone. In the wizard I am designing the user has the ability to choose
from one of n CSS style sheets to be applied to the end results of the
wizard. I am also thinking of supporting customization of the stylesheet
and this is where my question comes in. I have been commenting my
stylesheets using xml as a guide, for example

<data>
<name>Cool Blue</name>
<comment>yadd a</comment>
<styleset name="common">
<styles>
<style name="gridTitle ">This style is used to etc...</style>
<style name="gridBody" >this style is....</style>
</styles>
<raw>
dummy{}
.gridTitle{font-size:10pt;color :red}
.gridBody{fonts-size:8pt;color: black}
</raw>
</styleset>
...more styleset nodes
</data>
You will notice that the actual styles are contained in the node raw. I have
found that if a create a dummy() empty style the following styles are
correctly picked up by the css parser on all modern browsers!!

So even though this xml/css crossbreed seems to work I wonder if there is a
set way of doing this that I am unaware of. I have done some research but
have not found anything so though I would ask all you smart people.


I am not sure what you gain with the XML commenting and containing CSS
style rules as CSS has a syntax for comments but if you want to serve
the style rules to a browser as a text/css stylesheet then I strongly
suggest to use XSLT to extract them and to send only them to the browser.
That allows you to store the meta data you want to store with a style
sheet but also lets browsers only deal with what their CSS parsers are
supposed to deal with.

BTW: fonts-size is not the correct CSS property name.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #2
As I stated I am trying to kill to birds with one stone. I have checked
across several several different browsers and down level browsers as well
and there appears to be no problem with any of the browsers picking up the
CSS.

It was just an idea to try out and was curious as to feedback.

Regards
Keith
I am not sure what you gain with the XML commenting and containing CSS
style rules as CSS has a syntax for comments but if you want to serve
the style rules to a browser as a text/css stylesheet then I strongly
suggest to use XSLT to extract them and to send only them to the browser.
That allows you to store the meta data you want to store with a style
sheet but also lets browsers only deal with what their CSS parsers are
supposed to deal with.

BTW: fonts-size is not the correct CSS property name.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #3


Keith Chadwick wrote:
As I stated I am trying to kill to birds with one stone. I have checked
across several several different browsers and down level browsers as well
and there appears to be no problem with any of the browsers picking up the
CSS.


The CSS validator at
http://jigsaw.w3.org/css-validator/validator-text.html
will tell you that most of that example is unrecognized.
Even if the browsers can cope with your CSS in XML I don't think you
should send more to a browser than is needed and force them to try to
parse the XML as CSS if there are techniques like XSLT which would allow
you to extract the CSS rules from the the XML and just send that to the
browser.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #4
Agreed and again was just trying to kill two birds with one stone.

I will most like duplicate the css file as a true xml file then use a
transformation to write out the customized css files to each user folder
space when they choose to customize.

Cheers
Keith

"Martin Honnen" <Ma***********@ t-online.de> wrote in message
news:e9******** ******@TK2MSFTN GP10.phx.gbl...


Keith Chadwick wrote:
As I stated I am trying to kill to birds with one stone. I have checked
across several several different browsers and down level browsers as well and there appears to be no problem with any of the browsers picking up the CSS.


The CSS validator at
http://jigsaw.w3.org/css-validator/validator-text.html
will tell you that most of that example is unrecognized.
Even if the browsers can cope with your CSS in XML I don't think you
should send more to a browser than is needed and force them to try to
parse the XML as CSS if there are techniques like XSLT which would allow
you to extract the CSS rules from the the XML and just send that to the
browser.
--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #5

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

Similar topics

0
1286
by: Matt W | last post by:
Hi all, I'm planning to use MySQL's full-text search for my forum system (possibly 5+ million posts). I've been playing with it a lot lately to see the performance and functionality and have some suggestions/questions. First, since a few of you may be wanting to know, here is a thread where I was doing some speed/optimization tests and stuff with 3 million posts: http://www.sitepointforums.com/showthread.php?threadid=69555
10
1949
by: Ron Ruble | last post by:
I'd like to get suggestions from some of the folks here regarding tools and processes for a new, small development team. I'm starting a new job next week, and part of the fun is being able to start fresh. It's a bit different than what I've done in the past, in a smaller organization than I'm used to. Very small team; about 4 developers, 4 additional IT support
1
1343
by: Brian Basquille | last post by:
Hello all. Have been working on the Air Hockey game on and off for a couple of weeks now.. but have had plenty of other assignments to keep me busy along with it. But i would like some suggestions on improving it. It's far from fully working, but some suggestions on the following would be great. Please download it from: http://homepage.eircom.net/~basquilletj/AirHockey.rar.
62
2387
by: A.M. Kuchling | last post by:
Here are some thoughts on reorganizing Python's documentation, with one big suggestion. The tutorial seems to be in pretty good shape because Raymond Hettinger has been keeping it up to date. It doesn't cover everything, but it's a solid introduction, and if people don't find it works for them, they have lots of alternative books. No suggestions here. There are endless minor bugs in the library reference, but that seems
6
1410
by: iclinux | last post by:
I have to build a GUI applicaiton that could run on different OS such as windows and *nix, which GUI toolkit is better? Best Regards.
45
3425
by: Gregory Petrosyan | last post by:
1) From 2.4.2 documentation: There are two new valid (semantic) forms for the raise statement: raise Class, instance raise instance 2) In python: >>> raise NameError Traceback (most recent call last): File "<stdin>", line 1, in ? NameError
26
1844
by: Frank Samuelson | last post by:
I love Python, and it is one of my 2 favorite languages. I would suggest that Python steal some aspects of the S language. ------------------------------------------------------- 1. Currently in Python def foo(x,y): ... assigns the name foo to a function object. Is this pythonic? Why not use the = operator like most other assignments?
0
4482
rnd me
by: rnd me | last post by:
Purpose: Allows you to create "presets" for text form inputs. "Lightweight and simple to setup, it adds a lot of convenience for ~1kb of code." Only one function, two parameters: First argument is the element to upgrade. you can specify the input's name, id or the input itself. you can also pass an array containing of any of these to easily bind multiple fields to the same suggestions. Second argument is an array of suggestions.
0
8356
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8871
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6198
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.