Mozilla + CSS + XML = Structured, Formatted Content
Saqib Ali writes "Publishing XML content on the web requires some heavy processing on the server. There are many publishing framework (AxKit, Cocoon, etc) available in the market. However they are very CPU intensive. Apple's Internet Developer has a article on how to use CSS along with your XML content to render the formatted content in the Mozilla Web browser. It is very interesting read, especially for people who want to start creating content in XML, but don't want to invest in a expensive processing server/application. They have a nice example of RSS feed (XML) formatted for publishing in the browser."
tu slashdot?
I'm as mimsy as the next borogove but your mome raths are completely outgrabe.
I'm working on a some web log analysis software to license under the GPL. The output will be XML that is linked to CSS and Javascript. Besides being easily parsed by another program, the output is pretty, and the tables can all be sorted by any of their columns. It uses DOM Level2 functions called from MergeSort implemented in Javascript. Watch my website, I should have it done, or at least a first version within a couple weeks.
Just when you think Phoenix has saved you thousands of precious CPU cycles over Mozilla, something like this pops up and fills the hole. Doh!
What I need (as a C programmer) is a way of getting all the data structures in my program written out to XML, then sucked back in again.
.XML file somewhere ... but I'll be damned if I can find it. (libexpat is half-way there, but still a pain - writing handler functions for a parser is great and all, but ...)
.xml file ...
Here's the caveat: Easily.
Surely someones' got some tools for taking C code-style structs and turning them into an
All this talk of the wonder of XML and the benefits of using it as a store methodology is great and everything, but the 'ease-of-use' factor isn't really there with XML, as promised.
In the end, if you want to use XML programmatically, it's still just as much of a pain in the ass to use as if you were writing good-ol' C fread/fwrite-style save-/load-to-disk functions. The only difference is, with XML you get to read the results a little easier than raw binary structs written to disk.
If I'm clueless about these things please feel free to beat me with a stick. It's just that libexpat and the like are a *lot* of overhead for someone who just wants to be able to save and load data structures into an
; -- the corruption of government starts with its secrets. a truly free people keep no secrets. --
The link mentioned doesn't work well in Mozilla 1.2.1: no hyperlink.
;
And konqueror can't even render the page. It says its invalid:
XML parsing error
fatal parsing error: the document is not in the correct file format in line 6, column 37
<link>http://www.scottandrew.com</link>
^
DNA is the ultimate spaghetti code.
Having CSS functionality in XML is a Good Thing, but would it not be worth waiting for a full implementation of XSL functionality on the client side before embarking on a full-on application?
I thought the idea of XML was really to keep it server side...u know this whole platform independant thing they've been working to for ages? Dont wanna sound like a flamer but it seems pritty stupid to start the "oh you need this browser to view this site" wars again. Had enough of that in ye-olden days of NS vs. IE :)
"What do you mean you have no ice? Do you expect me to drink this coffee hot?" - Random Customer, Clerks
CSS along with your XML content to render the formatted content in the browser
Um, I thought that was what XSLT is supposed to do?
(Spudley Strikes Again!)
Umm... yeah. Can show me how serialize C structs in *any* portable data format easily? Serialization in C is non-trivial. Serialization in a portable format is *incredibly* non-trivial.
It's always a long day... 86400 doesn't fit into a short.
Check out the serialization engines (Xml.Serialization) in .NET (or Mono for that matter), they're great. They can easily serialize any objects to XML and deserialize them as well.
.NET for your needs, checking out how the serialization works might help you to write your own routines.
While you might not be able to use
Hope that helps...
Yeah, that's all well and good when you're writing managed code. Data structures in managed code have all sorts of nifty bits of meta-information floating about.
Now back to my point that serializing C structs is non-trivial.
It's always a long day... 86400 doesn't fit into a short.
You would have to parse the source files to get reflection. Wouldn't you?
A code-generation utility to write a FOO-serializing function for a struct FOO (given the source files where FOO and all sub-structs referenced in FOO were declared) might be worth having - a little bit like the proxy-generating utility I gather .net has for building classes out of WSDL files.
Experience is a hard school, but fools will learn no other.
Maybe gSOAP is the answer for your needs.
It is a library for C and C++ that generates codes for using (as a client) or providing (as a service) web services using the SOAP standard (based on XML).
If you give gSOAP a header file with the methods and structures of your code, it will generate all the needed methods and XML descriptors without giving you much trouble. From there it will be easy to serialize all your data in and out, and you won't have to care about the details of the XMLs. As an added benefit you will be able to share your data with software written in several other languages.
Fh