[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: adding xlink:type attribute





Benno Blumenthal wrote:

Ethan Davis wrote:

Hi Benno,

I've updated our main static catalogs to include xlink:type="simple". Haven't dealt with our generated catalogs yet.

Since all the uses of xlink in the InvCatalog schema at this point are simple xlinks, I was thinking it would be a convenience to provide a default value for xlink:type. That way all existing catalogs would automatically be complient with the XLink spec. At least they would look that way if the application was paying attention to the DTD/XSD. As with most default values in XML docs, I think explicitly including xlink:type="simple" in our catalog documents is the way to go. Just hoping to buy us some pain free complience.


My knowledge of XML is very limited, so please help me out here. My understanding of namespaces was that the href in the namespace was just a URI, i.e. an unique identifier, not a file to be read. In other words, a program can sort out the different name spaces without ever actually reading the files referenced. If one can put default values in a DTD (and presumably in a schema), then that would have to be read before the file could be "understood". So you are saying that Mozilla is required to read the dtd and/or schema before parsing the document? and if we put in default values for the xlink:type, the Xlink aware code would use that default value even though it does not understand much else in the thredds schem(a)? If so, that would be pretty interesting.


That's right, XML namespaces are just unique identifiers. Documents can give hints on the location of schemas but don't have to and that info can just be ignored anyway. So, Mozilla isn't required to read DTDs or schemas and I'm sure it doesn't try to validate much if any XML. I was just thinking a default value is a really easy change and might be useful to some applications. But now that you mention Mozilla again, I realize that there probably aren't many general applications that validate against DTD/schema so adding a default value may not be very useful. Other than XML parsers, editors, and such, I'm guessing only THREDDS aware applications will use the THREDDS schema.



I was just looking at your catalog at

http://iridl.ldeo.columbia.edu/SOURCES/thredds.xml

I see the xlink:type attributes but not the CSS stuff (<?xml-stylesheet type="text/css" href="threddsstyle.css" ?>). Do you have an example that does include that? Also, can you point me to your threddsstyle.css so I can take a look at it?


Yes, it is not there yet. css is pretty limited -- probably cannot do anything really useful with it (i.e. my current version mostly messes things up), but it is interesting because it handles namespaces. And because it shows that mozilla "understands" xlink. Here is my example (which should appear on the site tomorrow when I can install a new version).

@namespace threddsv06 url(http://www.unidata.ucar.edu/thredds);
@namespace thredds url(http://www.unidata.ucar.edu/namespaces/thredds/InvCatalog/v1.0);
@namespace xlink url(http://www.w3.org/1999/xlink);
@namespace mods url(http://www.loc.gov/mods/v3);
thredds|dataset {display:block; padding-left: 40px; list-style-type: disc;}
thredds|dataset:before {display:block; text-indent: -40px; font-weight:bold; content: attr(name)}
thredds|catalogRef:before {display:block; text-indent: -40px; font-weight:bold; content: attr(xlink|title)}
thredds|catalogRef {display:block; padding-left: 40px; font-weight:bold;}
thredds|dataset documentation{ display:list-item; font-weight:normal; color:green;}
thredds|dataset *{display:listitem; font-weight:normal;}
thredds|catalogRef documentation{ display:list-item; font-weight:normal; color:brown;}
thredds|catalogRef *{display:inline}
threddsv06|dataset {display:block; padding-left: 40px; list-style-type: disc;}
threddsv06|dataset:before {display:block; text-indent: -40px; font-weight:bold; content: attr(name)}
threddsv06|catalogRef:before {display:block; text-indent: -40px; font-weight:bold; content: attr(xlink|title)}
threddsv06|catalogRef {display:block; padding-left: 40px; font-weight:bold;}
threddsv06|dataset documentation{ display:list-item; font-weight:normal; color:green;}
threddsv06|dataset *{display:listitem; font-weight:normal;}
threddsv06|catalogRef documentation{ display:list-item; font-weight:normal; color:brown;}
threddsv06|catalogRef *{display:inline}
mods|mods{display:block; color:black}
mods|mods role,originInfo,typeOfResource,identifier,caption{display:none; color:green}
mods|mods relatedItem:before {color:black; content: " in "}
mods|mods part detail[type="volume"] {display:inline;font-weight:bold; color:brown}
mods|mods part detail[type="issue"] {display:inline;font-style:italic; color:brown}
mods|mods part detail[type="issue"]:before {content: "("}
mods|mods part detail[type="issue"]:after {content: ")"}
mods|mods part extent[unit="page"]:before {content: "pp"}
mods|mods part extent[unit="page"]:before {content: "pp"}
mods|mods subTitle:before {content: "--"}
mods|mods end:before {content: "--"}
mods|mods part:after {content: "."}
mods|mods titleInfo{font-style:italic;}



Note that I was contemplating inserting a mods namespace for references, which is why the mods tags were there.


However, one could alternatively specify an XSLT stylesheet, which should be able to render a THREDDS xml file usefully. And one could use javascript if necessary to create buttons, etc.
But I have not gotten there yet.


OK. Thanks for the CSS.

Ethan


Benno









Thanks,

Ethan



Benno Blumenthal wrote:

Ethan Davis wrote:

Hi Benno,

I will go through our catalogs and add the xlink:type attribute. I'll also add it to our catalog generation tools.




That would be great.


In the InvCatalog 0.6 spec xlink:type had a default value of "simple". Looks like that got dropped in 1.0. Does adding this as a default seem like a good idea? Or would requiring it but no default value be preferable?


my reading of xlink is that xlink:type is required, and the way we are using xlink its value is "simple".
There is no provision for a default value.


The reason for doing this is so that we can build on top of software that already understands xlink, which, if we have not written it, is expecting xlink:type="simple" before processing it.

Benno





-- Ethan R. Davis Telephone: (303) 497-8155 Software Engineer Fax: (303) 497-8690 UCAR Unidata Program Center E-mail: address@hidden P.O. Box 3000 Boulder, CO 80307-3000 http://www.unidata.ucar.edu/ ---------------------------------------------------------------------------



NOTE: All email exchanges with Unidata User Support are recorded in the Unidata inquiry tracking system and then made publicly available through the web. If you do not want to have your interactions made available in this way, you must let us know in each email you send to us.