Warning:
This wiki has been archived and is now read-only.

Web of XML or, the XML Web

From XML Hypermedia Community Group
Jump to: navigation, search

The primary use case for standard hypermedia vowels is to enable a web of XML, whether in static files or meted out RESTfully by servers.

Consider a web of xml resources. In XML, it is by design that content models can be created ad hoc, by designers. In order to link these files together to create a web, it would be necessary to create hyperlinks in related files. So, we would need a way to create hyperlinks in these files that would be standard across all the files. This is where the @href and @src attributes are valuable - they are a simple standard means to bidirectionally link files together. They are recognized and 'understood' by developers as is, due to long usage.

Now, consider an application that is designed simply to read these files by following the links between them.

In order to allow the application while processing one XML file in that web, to know whether it could process another linked file, it would be either necessary to either a) retrieve that file and 'sniff' it, or to examine the link metadata in the first file to determine if the linked-to file was of a type which the application 'understood'.

Either all files in the web must share the same 'type', so there is no need to know if the linked to file can be processed, or the links must carry some link metadata which identifies the type, so the application can decide in advance (ie without having to read the file) if it should read the file. It is clear that not all XML files will share the same 'type', so the normal situation is that the link should be documented with 'type' metadata. So this is where the @type attribute is valuable - it provides a simple means to annotate the links with standard file type information.

Now consider the possibility of an XML vocabulary defined to document a domain, let's say Scotch whisky. Call it ScotchML. In this markup language, there are elements which define links to images, typically from the history of vintage scotches. The first consideration is that the images are not typically XML vocabularies (but they can be), and are therefore stored as separate files. But, the demands of documenting old scotch being what they are, it is necessary to link to the appropriate images. This is where both the src element *and* the type element are useful.

Now, consider the situation where, the application which is reading the files has been programmed to only read files with content in the french or english languages.

Now consider the fact that some files will be too big to individually process - they won't fit into available memory, even if processed as plain text. It could be valuable to allow composition of files such that they could be processed as components. This is where both the @src and @rel(='next', in this case) attributes can be valuable - it allows links to be created which have an 'include' semantic, but also to allow the overall requirements of the whole model to be split into manageable chunks of data. Still, @type is necessary to know whether the type of the linked to file is 'understood', as is '@hreflang' necessary to be certain that the language of the linked-to file is either french or english (in this scenario).