Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD Beta Forum Goto page Previous  1, 2
Zugg Posted: Wed Aug 30, 2006 5:07 pm
Import/Export and XML format vs zMUD format
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Tue Sep 05, 2006 4:03 pm   
 
Right...I understand that "well formed XML" requires a root node. And certainly CMUD would *output* that in the XML export. But what I was saying is what if people post only a subset of the XML to the forums. It would be nice if CMUD could *read* mal-formed XML that is missing the root object.

Does using a style sheet allow stuff like omitting the "name=" part of the attribute? Can you make it so that the first attribute is always assumed to be the "name" attribute?

And what advice on handling the issues Rorso mentioned with CDATA. What if the user's script contains the ]]> marker? Seems like that is a common situation, so there must be a common solution.

Is there *any* way to allow the user to use a < in the script without converting it to a & lt ; or a CDATA?

It would be nice if I could stick with the XML standard for the power users and yet still make it more readable for novices and people who just want to post script snippets to the forum.
Reply with quote
bortaS
Magician


Joined: 10 Oct 2000
Posts: 320
Location: Springville, UT

PostPosted: Tue Sep 05, 2006 6:53 pm   
 
Quote:
Does using a style sheet allow stuff like omitting the "name=" part of the attribute? Can you make it so that the first attribute is always assumed to be the "name" attribute?

Not really ommiting, but transforming into something else. So something like <var name="a"></var> could converted into something like:

<var>
<a>value</a>
</var>

Quote:
Is there *any* way to allow the user to use a < in the script without converting it to a & lt ; or a CDATA?

Nope, that's the standard way of doing it in xml elements. Xml is not really good for displaying things, that's why technology like XSLT was created. I always treat xml as a datastore, in other words, not really for user comsumption. That's why I always end up creating stylesheets or a "viewer" utility.
_________________
bortaS
~~ Crusty Klingon Programmer ~~
Reply with quote
Rainchild
Wizard


Joined: 10 Oct 2000
Posts: 1551
Location: Australia

PostPosted: Tue Sep 05, 2006 10:27 pm   
 
I still haven't "seen the light" when it comes to XML, IMO I find it somewhat lacking in practicality, not that I have any suggestions on what would be a better thing to use. But just because there may not be a better thing, doesn't mean XML is a good thing - more a necessary evil.

We use XML to transfer data between the PC and Pocket PC at work, it's amazing how much wasted space the markup has for example <quantity>1</quantity> ... that's 21 characters of mark up for a single digit. Then you have to & amp ; all the ampersands in the product descriptions, and occasional products have áëîõù so you have to substitute those too. I imagine that you will need to plan ahead at least in your mind mind how you would handle copy/pasting when international mudders may have triggers/aliases that include multibyte data.
Reply with quote
Alyssandra
Newbie


Joined: 13 Dec 2005
Posts: 8
Location: Botley, Oxford, United Kingdom

PostPosted: Wed Sep 06, 2006 8:51 am   
 
A properly formated UTF8 XML file shouldn't need to escape anything as an entity apart from &, < and >. The light with XML comes when you have 50 different systems that all want the same information in a different format and you can just apply simple XSLTs rather than right 50 different adaptor classes for your application.
_________________
All is fair in love and war...

...as long as I'm not losing
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Sep 06, 2006 5:08 pm   
 
Rainchild, I can really understand how you feel. I was reading an article the other day about "abundance programming" vs "scarcity programming". I think we were both raised as "scarcity programmers". I know that I'm *always* worrying about stuff like memory usage and speed. And XML always bugs me because of all of the unnecessary text. Notice how when I used XML in designing MXP I left out most of the attribute names?

The point of the article was that in these days of cheap and common memory, large disk drives, fast processors, that programmers should worry less about resources and worry more about building a better piece of software that is more useable. I still have a hard time with this myself. zMUD is fast and efficient because I try to pay attention to memory and resource issues. Bloated stuff like .NET really bothers me. But the article does have a point, and I'm trying to make sure memory and disk issues don't cause me to overlook the value of stuff like XML.

As people have mentioned, for all of it's drawbacks, the advantage of XML is that it's a standard with lots of software that uses it. It's a relatively easy way to transfer structured data between applications. So, for a copy/paste format it's pretty good. I still don't like it's wordiness and the issues with escaping "special characters". But it's about the best that we have for a standard for now. So yes, it's a "necessary evil".
Reply with quote
hav
Wanderer


Joined: 05 Oct 2004
Posts: 61
Location: Riga, Latvia

PostPosted: Wed Sep 06, 2006 8:34 pm   
 
So, wait, the big selling point of XML is its usability across different software, which is non-issue since what else will use cmuds export besides cmud itself? Export is intended as a lossless db dump, not intended for human readability. Or so I understand the good intentions from reading first post of the thread.
Correct me if I'm wrong, would it not be simpler to dump the sqlite db file since its not indended to be readable anyway?
Then on top of that you could add human-readable output that would work one-way only (export-only) to please certain individuals like Vitae.
Edit: Come to think of it, doesnt cmud already have export? Copy pkg file containing your settings, windows and modules to wherever you need it to with any file manager, export complete? What is XML trying to achieve again? I'm a bit lost here.
Reply with quote
bortaS
Magician


Joined: 10 Oct 2000
Posts: 320
Location: Springville, UT

PostPosted: Wed Sep 06, 2006 10:25 pm   
 
Quote:
So, wait, the big selling point of XML is its usability across different software, which is non-issue since what else will use cmuds export besides cmud itself? Export is intended as a lossless db dump, not intended for human readability. Or so I understand the good intentions from reading first post of the thread.
Correct me if I'm wrong, would it not be simpler to dump the sqlite db file since its not indended to be readable anyway?

That's the same point I made earlier in this thread. Idea

Quote:
Edit: Come to think of it, doesnt cmud already have export? Copy pkg file containing your settings, windows and modules to wherever you need it to with any file manager, export complete? What is XML trying to achieve again? I'm a bit lost here.

The pkg file are actually SQLite databases, so the xml export that CMUD does is just a dump of the SQLite (pkg) database.
_________________
bortaS
~~ Crusty Klingon Programmer ~~
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Wed Sep 06, 2006 11:12 pm   
 
hav, CMUD already has export (and copy/paste). This thread has a mix of stuff from what CMUD already does, and what is planned for the future. As I've said, human readability is planned, it just wasn't a priority in getting the basic import/export copy/paste stuff working.

And yes, the selling point of XML is the usability across different software, but I think you'll be surprised to see all the applications people come up with. It allows the use of external editors and with the XML support in zApp, parsing the XML within zApp scripts could also be useful.

What you are saying is correct, which is why the current dump format is just a raw SQLite database dump. It didn't need to be very readable to implement the basic features. But obviously from the other opinions and discussions here, there is a desire for a more readable format, and it will be easy to improve that in the future.
Reply with quote
hav
Wanderer


Joined: 05 Oct 2004
Posts: 61
Location: Riga, Latvia

PostPosted: Thu Sep 07, 2006 5:17 pm   
 
zApp huh. Cool. What mostly caught my attention was a very high number of posts of seemingly difficult to implement and low on priority issue.
May I suggest putting XML on backburner together with SSL support, and get all the major features working and show-stopping bugs stamped out first?
Reply with quote
Zugg
MASTER


Joined: 25 Sep 2000
Posts: 23379
Location: Colorado, USA

PostPosted: Thu Sep 07, 2006 8:16 pm   
 
hav, that's already what I've been saying. The readable XML changes *are* a lower priority feature and won't get implemented until the basic functionality is stable and the major bugs are gone. But it's still part of the "Feature Phase" of the Beta and will probably be done before SSH is done.
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Thu Oct 26, 2006 1:19 pm   
 
Sorry to revive an old topic, but unless I've misunderstood something I read, XML is case sensitive and I have a question.
Now, normally I copy and paste everything that i might need to use. If I need the name of a variable, I'll go TO the variable and copy it. It's a slow way, but at least it avoids my stupid misspellingss.
Of course there's no way around misspellings, but at times, I might name a trigger AWayOfNamingATrigger (capping the 1st letter of each word) does this mean that when trying to disable/enable triggers, or using variables to other things, that if the exact case is not use there will be a problem?
While CMUD exports in XML, I am unclear if the code is executed in XML.
Just wondering in case there are others that might be having problems with thier scripts and do not realize this issue with XML.

Thanks.
_________________
http://www.Aardwolf.com
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Thu Oct 26, 2006 2:44 pm   
 
To my knowledge the code does not execute in XML, it stays with zScript.

But more to (what I think is) your concern, it is not case sensitive. So unless I'm having a brain malfunction MyVar is the same as myvar and MYVAR.

Admittedly I haven't tried it for triggers, but I'd be surprised if it was.
_________________
Asati di tempari!
Reply with quote
Vitae
Enchanter


Joined: 17 Jun 2005
Posts: 673
Location: New York

PostPosted: Fri Oct 27, 2006 4:57 pm   
 
No prob, was just wondering. :-)
_________________
http://www.Aardwolf.com
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD Beta Forum All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net