A Conversation for The GuideML Editor Writers' Caffeine Machine
- 1
- 2
GuideMLPreview
Jonny Started conversation Dec 5, 2001
Hi MaW,
Could you add my project which should be finished and available soon. (I've just got a few more tags to work out). I know that people keep saying it'd work a lot better using XML templates, but this seemed easier somehow.
GuideMLGuide:
Is a C++ project which takes GuideML code and translates to HTML. The user can enter GuideML into a notepad style textview, and then select "Preview in Alabaster" or "Preview in Classic Goo". This allows people to learn GuideML whilst offline, so they can see what they're doing.
Thanks,
Jonny
GuideMLPreview
Jonny Posted Dec 5, 2001
, forgot to mention the entry here:
http://www.bbc.co.uk/h2g2/guide/A618077
GuideMLPreview
MaW Posted Dec 5, 2001
Added it. Do you want to be listed in the authors section too? If so, can you provide a little something you want to be said about you? I don't want to make it up, because I'll get it wrong.
GuideMLPreview
Jonny Posted Dec 6, 2001
OK, yes please:
I'm a 16 year old AS level student studying Further Maths, Physics and Electronics. I write C++ projects in my spare time. GuideMLPreview is my first real project, so please be nice to me!
Thanks,
Jonny
GuideMLPreview
Frankie Roberto Posted Dec 9, 2001
Interesting project.
When GuideML 1.0 is released, we'll all be able to write our own XSLTs for the language for offline-use (effectively creating our own skins). Parsing these isn't the easiest thing to do at the moment (you need a patch from microsfot, MSXML 3.0) - maybe your programme could incorporate this?
Forgive me if I'm chatting b*****x (that the right number of asterixes?), I'm new to all this stuff.
GuideMLPreview
MaW Posted Dec 10, 2001
Yes, you seem to have the right end of the stick, but I hasten to point out that if you have a POSIX API on your operating system (Linux, other UNIX flavours, Mac OS X, Windows with Cygwin or other things too), you can use non-Microsoft XML parsers. If you want to...
You don't have to of course, but I'm told libxml and libxslt are quite good. Haven't tried them myself yet though.
GuideMLPreview
Jonny Posted Dec 10, 2001
I'm not really sure about XML (I've not really had the time to do much research to be honest). I just thought that if the parser converts from GuideML to HTML, then logically each tag must have an HTML equivalent. I've had to view each tag and save an example of each tag to find out what it does and then work out a way of making the program convert from GuideML to HTML. It's just about working, I've still got a few final tags to do, and then I'll release it.
GuideMLPreview
Frankie Roberto Posted Dec 10, 2001
It might not just be one equivilent tag though, there might be a whole host of tags associated with it, like FONT tags and Javascripts.
GuideMLPreview
Jonny Posted Dec 11, 2001
Very true, for example the header tag in goo incorporates several images, a font, and a table. And you don't want to know the tags I've got for FOOTNOTE!
GuideMLPreview
MaW Posted Dec 11, 2001
* shudders *
Footnotes normally need some kind of structure in memory to shove them all in while you finish parsing the document, then spit them all out at the end...
* shudders again *
GuideMLPreview
Jonny Posted Dec 11, 2001
Yes, I've had to have a CString variable to hold the data of all the footnotes which is added to the bottom of the finished page. Problem is, the routine that handles can only read what's inside the footnote tag, but that becomes a problem if there's another tag inside the FOOTNOTE tag, such as:
This is very difficult
The real problem is something like:
This is very difficultBecause of all the footnote tags.
Mind Taxing time again!
I think the FOOTNOTE tag is the only one that still needs a lot of work doing.
Jonny
GuideMLPreview
Felonious Monk - h2g2s very own Bogeyman Posted Dec 18, 2001
Seriously Jonny, consider using a standard XML parser for converting the GuideML to HTML. It'll save you a hell of a lot of work. And it'll save the footnotes in memory for you to write them out later. If you have an ideological problem with Microsoft (as many people do) then you can use another parser. They all use the same XML document object model so once you've learned one you've effectively learned them all. I use the thing most days in my job.
FM
GuideMLPreview
Jonny Posted Dec 19, 2001
I'm not sure, I'm willing to be swayed here. But won't the XML parser need more data than is available. The italics are keeping a lot of things close to their chest, such as the DTD.
GuideMLPreview
Felonious Monk - h2g2s very own Bogeyman Posted Dec 19, 2001
I'm just approaching it from the standpoint of handling the problems you mentioned earlier, such as having tags embedded inside footnotes. The XML parser will handle that without any problem, as it builds up a tree (the Document Object Model) in memory which you then traverse in code. You also don't need a DTD to use it, just make sure that the XML is well formed. If you are feeling brave you can also use the SAX parser, which is event driven and builds no data structures.
Mercifully, all footnotes come right at the end of the article and not on the bottom of each page. So what I suggest you do is:
1: Parse and render the main body of the article, replacing each footnote with a mark in the text
2: Print out (in order) each of the footnotes embedded within the main body.
3: Apply steps 1 and 2 to each *footnote* recursively.
GuideMLPreview
MaW Posted Dec 20, 2001
A DTD is only necessary for validating XML to see if it conforms to the spec for whatever language the DTD is for (i.e. GuideML). And since the Towers don't have a DTD anyway...
What they're keeping close is the XSLT style sheet which turns GuideML into a beautiful Goo page or a garish Alabaster one. And to be honest, I don't really blame them - yes, I believe in Open Source, but there's no real need for anyone outside h2g2 to parse GuideML into exact lookalikes of h2g2 pages... that could be potentially problem-causing for h2g2.
I do have plans for a new improved GuidePost, but at the moment I have no time to execute them... so I'll just hang around and provide moral support.
Except right now I have to go to work and battle the evil Microsoft demons (ever written for Windows CE? Don't!)
GuideMLPreview
Felonious Monk - h2g2s very own Bogeyman Posted Dec 20, 2001
I'd suggest that whatever plans TPTB have for the XSLT, that you do what you want to do anyway. I don't see much point in pouring cold water over a keen young programmer's plans. You're doing this for intellectual interest and the best of luck to you. You will have to accept, of course, that it may never get used in anger.
As I said to MaW, I'm looking into producing a WYSIWYG editor for GuideML. I'm coming around to the idea that the easiest way of doing this is to use Word 2000 to save a raw HTML file, then parse the HTML file using the MSHTML library and recast it as GuideML using MSXML. Should be fun :-|
GuideMLPreview
MaW Posted Dec 20, 2001
And as I said at the time, that seems like a bit of a long way around, but it will probably work...
I still have no time
Oh well, when this big website I'm working on is up and running I can turn my attentions once more to GuidePost.
GuideMLPreview
Jonny Posted Dec 20, 2001
Yes, I've been looking at the XML SDK and I think it looks quite possible. It does seem that the key is the XSLT. I'll keep looking at it, with the data I've got for the original idea, I might be able to develop it from their.
Jonny
GuideMLPreview
MaW Posted Dec 21, 2001
XSLT does seem to be remarkably powerful, useful and an all-round Good Thing to know. I must learn it some day...
Key: Complain about this post
- 1
- 2
GuideMLPreview
- 1: Jonny (Dec 5, 2001)
- 2: Jonny (Dec 5, 2001)
- 3: MaW (Dec 5, 2001)
- 4: Jonny (Dec 6, 2001)
- 5: Frankie Roberto (Dec 9, 2001)
- 6: MaW (Dec 10, 2001)
- 7: Jonny (Dec 10, 2001)
- 8: Frankie Roberto (Dec 10, 2001)
- 9: Jonny (Dec 11, 2001)
- 10: MaW (Dec 11, 2001)
- 11: Jonny (Dec 11, 2001)
- 12: Felonious Monk - h2g2s very own Bogeyman (Dec 18, 2001)
- 13: Jonny (Dec 19, 2001)
- 14: Felonious Monk - h2g2s very own Bogeyman (Dec 19, 2001)
- 15: Jonny (Dec 19, 2001)
- 16: MaW (Dec 20, 2001)
- 17: Felonious Monk - h2g2s very own Bogeyman (Dec 20, 2001)
- 18: MaW (Dec 20, 2001)
- 19: Jonny (Dec 20, 2001)
- 20: MaW (Dec 21, 2001)
More Conversations for The GuideML Editor Writers' Caffeine Machine
Write an Entry
"The Hitchhiker's Guide to the Galaxy is a wholly remarkable book. It has been compiled and recompiled many times and under many different editorships. It contains contributions from countless numbers of travellers and researchers."