Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > css / xml question

css / xml question
Thread Tools
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Sep 28, 2004, 03:08 AM
 
I've found a neat trick, if I declare...

Code:
<?xml-stylesheet type="text/css" href="bla.css">
....in the top of an xml file I can then use a style sheet with the xml attributes as styles.

To explain, here is the xml....

Code:
<title> hello worm </title>
here is the bla.css

Code:
title{ font-size:14px; }
Works wonderfully, problem is, the style sheet that is being used for the project has illegal syntax for xml, as in...

Code:
#title{ font-size:14px; } or .title{ font-size:14px; }
I get error messages if I try and format xml like...

Code:
<#title> Hello worm </#title> or <.title> Hello worm </.title>
Question, are those "#"'s and "."'s ( before the "title" description )really necessary in the style sheet?

Here's me thinking it would be a quick qestion
     
skalie  (op)
Mac Elite
Join Date: Mar 2002
Location: Clogland
Status: Offline
Reply With Quote
Sep 28, 2004, 03:53 AM
 
Um, found a workaround, adding a second selecter to the stylesheet....

Code:
#title,title{ font-size:14px; }
     
Clinically Insane
Join Date: Nov 1999
Status: Offline
Reply With Quote
Sep 28, 2004, 05:42 AM
 
If the XML validates against a DTD, and one of the attributes is specified as type ID, then the ID selector (#) should work.

There is, however, no standard way of making the class selector (.) work; the CSS parser has to Just Know that a given doctype uses classes.
You are in Soviet Russia. It is dark. Grue is likely to be eaten by YOU!
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:12 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2