Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Question about CSS and XML

Reply
Thread Tools

Question about CSS and XML

 
 
kdjansen@args.k12.va.us
Guest
Posts: n/a
 
      06-17-2008
I've been using XML to define 3d map geometry for a game engine, like
this:

<wall x1="-1000" y1="300" x2="1000" y2="300" z="0" height="100"
texture="nature/wood001" />

However, I would like specify the texture not by a filename, but by a
CSS style, like this:

<wall x1="-1000" y1="300" x2="1000" y2="300" z="0" height="100"
style="texture-group: nature; texture-resolution: xx-high; texture-
family: wood; target: wall;" />

because textures could then be defined with external stylesheets and
allow reuse with class attributes.

However, there are no CSS specifiers for things like textures or image
resolution.

I have looked into other things like XSLT, but those are not what I'm
looking for (although I did use XSLT to make SVG overview maps)

Is there any way to create custom CSS attributes and apply it to an
XML document? Or at least a library that will store non-standard
attributes?
 
Reply With Quote
 
 
 
 
Joseph J. Kesselman
Guest
Posts: n/a
 
      06-17-2008
> However, there are no CSS specifiers for things like textures or image
> resolution.


So you first need to invent the markup conventions for those properties.
I'd suggest separate attributes rather than CSS strings, since distinct
properties are easier for software to manipulate than a string which has
to be re-parsed every time.

I suspect XSLT is, in fact, the simplest way to apply non-CSS styling to
a document.

CSS really is HTML-oriented. XSLT is a more general tool.
 
Reply With Quote
 
 
 
 
kdjansen@args.k12.va.us
Guest
Posts: n/a
 
      06-17-2008
On Jun 17, 2:27*pm, "Joseph J. Kesselman" <(E-Mail Removed)>
wrote:
> *> However, there are no CSS specifiers for things like textures or image
> *> resolution.
>
> So you first need to invent the markup conventions for those properties.
> I'd suggest separate attributes rather than CSS strings, since distinct
> properties are easier for software to manipulate than a string which has
> to be re-parsed every time.
>
> I suspect XSLT is, in fact, the simplest way to apply non-CSS styling to
> a document.
>
> CSS really is HTML-oriented. XSLT is a more general tool.


I have tried using separate attributes, but they are not as reusable
and do not cascade.

CSS (or something similar) strings are the best way I can think of.

I am looking into SAC to parse this. I may have to modify it to accept
non-HTML-CSS, but it beats writing my own parser from scratch.

Speed is not a significant issue, since I am converting it into a
series of C arrays and structures at load time.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting 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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: correction: A question about css (was: A question about css) richard HTML 12 03-09-2010 08:52 PM
CSS question - can I make CSS Cascade sideways? Bill_W_Stephens@yahoo.com HTML 6 03-18-2006 06:02 PM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
Whining and bitching about MSIE 6 CSS bugs and CSS support =?ISO-8859-1?Q?G=E9rard_Talbot?= HTML 0 07-09-2005 06:48 AM
CSS Layout question - how to duplicate a table layout with CSS Eric ASP .Net 4 12-24-2004 04:54 PM



Advertisments