PDA

View Full Version : Can we 'force' .css into the .xml anywhere?



DrClarke
June 27th, 2007, 17:50
I've been completely unsuccessful so far. I wanted to gain a bit more visual creative control in some areas and my first thought was to utilize .css

An example would be trying to manipulate one of the client.xml files located in any .mod

My example/test was to create a superscript ability that would to true superscript and give me more options than just the standard fake three I can get with ISO-8859-1.

I've tried a handful of ways, and I'll list off a few. I added them after the:


<?xml version="1.0" encoding="ISO-8859-1"?>

I've tried:


<?xml-stylesheet type="text/css" href="../something.css"?>

<?xml-stylesheet type="text/css" href="/something.css"?>

<?xml-stylesheet type="text/css" href="something.css"?>

<?xml-stylesheet type="text/css" href="https://www.mydomain.com/folder/something.css"?>

Example of .css I'm trying:


@charset "utf-8";
/* CSS Document */

sup {
font-size: smaller;
vertical-align: baseline;
position: relative;
bottom: 0.33em;
}

sub {
font-size: smaller;
vertical-align: baseline;
position: relative;
bottom: -0.25em;
}

kalmarjan
June 27th, 2007, 18:22
Tsk Tsk. First off, you seem to be confusing XML files with XHTML. FGII uses XML as a database, and calls up the snippets of information on demand. Using CSS to display XML data is frowned upon. LOL. You could try xslt, but I cannot see that working.

Basically, all the xml coding/scripts for the display of FGII is CSS, albeit in the longhand way. For instance, you define the font that displays in the chat window, and reference it in the xml files. Basically the same as CSS.

So, I do not believe that CSS would be incorporated, but you could play around with the code in the scripts/xml files to do what you want to.

As for your CSS code, you are asking the font size to be smaller than regular, with a spacing in between lines, placed in such a way as to appear to be sub/superscript. You could try to do this in converting the fonts to fgf format, after editing them in a font editor to affect the placement of the vector images. The converter creates bitmap images of the fonts, so that would be about the only way you could do what you want.

Hope that clears things up.

Sandeman

DrClarke
June 27th, 2007, 19:03
I'm not trying to confuse the two :) I understand the purpose of xml and what it is, but this is the first time I've ever found a desire to dabble in it. (I thought about xslt, but my unfamiliarity with it and the too numerous negative comments on the web made me shy away from it.)

I guess I was assuming that I could cheat, so to speak, and call upon some .css from elsewhere. Hey, I had to give it a try! :)

So from this point on, I'll simply view the xml as a flat file database.

Playing around with the scripts/xml sounds a lot more feasible than creating new fonts :)