|
[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Why you should avoid Notation Declarations (by Kohsuke
At 2005-02-23 07:53 -0500, Elliotte Harold wrote: >Henry S. Thompson wrote: > >>You have a place in your XML document type for (e.g. hex-encoded) >>BLOBs to be included or referenced. Each BLOB in turn should be an >>encoding of something using one of a delimited set of more-or-less >>standard encodings. You want to allow or require document authors to >>signal which encoding they're using. > >How do notations improve on, for example, <data mime:type="image/jpeg" >href="somefile.jpg"/>? Normally I like additional layers of indirection, >but the NOTATION indirection has never seemed all that useful. What am I >missing? As I see it, a NOTATION declaration is necessary to complete an unparsed entity declaration. A relative value for the SYSTEM URI of an unparsed entity declaration is resolved to an absolute URI. I use unparsed entities in my publishing. Where you have href="somefile.jpg" ... that could be seen just as a string ... nothing in the system resolves that to an absolute URI specification. However, if you had an unparsed general entity declaration: <!ENTITY house SYSTEM "somefile.jpg" NDATA "JPEG"> and you referenced it as: <data ent="house"> then in XSLT you use: unparsed-entity-uri(@ent) you end up with "file:///c:/your/path/here/somefile.jpg" resolved according to the location of the parameter entity fie in which your unparsed general entity is declared. So, when publishing from a suite of files, you end up with an absolute URI pointing directly to the file, without having to know things like the current directory. If you move your environment around, and adjust your declarations accordingly (which may not need any changing), the unparsed-entity-uri() gets you what you need. I don't see much utility for unparsed entity declarations in a web based application for web pages ... you aren't trying to resolve absolute URIs into your publishing environment when creating a web page. So, now you've got this unparsed general entity declaration ... to be complete the notation referenced has to be declared in a notation declaration, hence the need for <!NOTATION>. I've often wondered why the XSLT commmittee would give us unparsed-entity-uri() without giving us unparsed-entity-notation-name() and unparsed-entity-notation-uri() as well, but I'll never know. Therefore, NOTATION is in support of unparsed entities which are useful. I hope this helps. ...................... Ken -- World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@C... Crane Softwrights Ltd. http://www.CraneSoftwrights.com/x/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/x/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|
|||||||||

Cart








