![]()
This is my blogchalk:
United States, California, San Francisco, Cow Hollow, English, Alison, Female, 31-35.
| Wednesday, October 16, 2002 | |
All Attributes, not just Namespaces, are Ugly..
Don Park may have saved my booty. I have been banging my head trying to come up with a password-XML schema. It has to be scalable. There will be extensions later on.
It has to be simple. Veteran mainframe programmers will not put up with ugly nested loops checking for elements, attributenames, attributevalues, subelements "your generation and all of this xml stuff" they'll say "we got along just find without wrapping these ugly tags around plaintext".
Maybe this is a no-brainer to seasoned XMLgroks: when (other than for namespace references) does one use attributes instead of subelements? While Don hates namespaces, I hate attributes. All attributes, not just namespaces, are ugly.
His comment is so sound it easily applies to my project, which never was and never will use namespaces. Only a few terms will need to be tweaked. (And the credit will still go to Mr. Park.)
[BlogFish]InRSSXML, there are two areas where extensions are most likely, inside <channel> and inside <item>. To support extensions in these two areas, we introduce three rules:
RSSparsers must ignore unknown tags.- Unknown
RSStags are opaque - this means you cannot enumerate its children.- Encapsulate custom tags inside a tag whose name starts with domain name.
Here is an example:
<channel>
...
<com.docuverse.daily.tags>
<title>semantics of extension tags are context sensitive.</title>
</com.docuverse.daily.tags>
<item>
...
<org.slashdot>...</org.slashdot>
</item>
...
</channel>This approach to extensions can easily be manipulated using simple regular expression based tools. Its easy to read and write. Its namespaces done right. Its a solution that is willing to sacrifice that problematic 20% in return for simplicity.
Don Park may have saved my booty. I have been banging my head trying to come up with a password-XML schema. It has to be scalable. There will be extensions later on.
It has to be simple. Veteran programmers will not put up with ugly nested loops checking for elements, attributenames, attributevalues, subelements.
Maybe this is a no-brainer to seasoned XMLgroks: when (other than for namespace references) does one use attributes instead of subelements? While Don hates namespaces, I hate attributes. All attributes, not just namespaces, are ugly.
His comment is so sound it easily applies to my project, which never was and never will use namespaces. Only a few terms will need to be tweaked. (And the credit will still go to Mr. Park.)
InRSSXML, there are two areas where extensions are most likely, inside <channel> and inside <item>. To support extensions in these two areas, we introduce three rules:
RSSparsers must ignore unknown tags.- Unknown
RSStags are opaque - this means you cannot enumerate its children.- Encapsulate custom tags inside a tag whose name starts with domain name.
Here is an example:
<channel>
...
<com.docuverse.daily.tags>
<title>semantics of extension tags are context sensitive.</title>
</com.docuverse.daily.tags>
<item>
...
<org.slashdot>...</org.slashdot>
</item>
...
</channel>This approach to extensions can easily be manipulated using simple regular expression based tools. Its easy to read and write. Its namespaces done right. Its a solution that is willing to sacrifice that problematic 20% in return for simplicity.
Yet another one of those questions I did not have an answer to. "Encoding? Why? Can't you just write it out in hex?"
That's entirely possible. I need to understand the consequences of failing to encode before I will know for sure. Jotting down xmlhack's index of encoding articles for tonight's reading.
More notes on encoding, from the exPat FAQ:
By default, expat assumes that documents are encoded in UTF-8. In UTF-8, ASCII characters are represented by a single byte as they would be in ASCII, but non-ASCII characters are represented by a sequence of two or more bytes all with the 8th bit set. The encoding most widely used for European languages is ISO 8859-1 which is not compatible with UTF-8. To use this encoding, expat must be told either by supplying an argument of"iso-8859-1"toXML_ParserCreate, or by starting the document with<?xml version="1.0" encoding="iso-8859-1"?>.
This [Free2Code Tutorials] site looks like it has some interesting tutorials. I'm jotting down some that might apply to my current work assignment (the third one is a stretch, but hey):
Cipher Tutorial. Cipher Tutorial
Creating Encryption Programs in C. This tutorial will teach you howto write your very own encryption programs in the C programming language!
Computer tricks to show your friends. This is a complimation of computer tricks, mainly security and privacy related.