![]() |
ResourcesFor developers, there are two main usages for Structured Blogging:
We’ll outline how to use Structured Blogging in those ways, plus we’ll explain how to convert the Structured Blogging XML into other formats (like RDF). Before you read this documentThis will make a lot more sense if you first use a Structured Blogging plugin to create a piece of microcontent, then "view source" on the resulting HTML to see how it is marked up with microformats, and followed by a chunk of XML inside a <script type="application/x-subnode; charset=utf-8"> block.
Using Structured Blogging in your own softwareThe Structured Blogging plugins incorporate microcontent editing and display libraries. PHP developers If you are using PHP, you can use the library inside the Wordpress plugin. See /wp/wpsb-files/microcontent/microcontent.php, which is called from /wp/wp-admin/sb-edit-form.php. Perl developers If you are using Perl, you can use the Movable Type plugin's library. See /mt/plugins/StructuredBlogging/lib/MicroContent.pm, which is called from /mt/plugins/StructuredBlogging/StructuredBlogging.pl. How microcontent types are defined The microcontent types are defined by the XML files inside the 'descriptions' subdirectory: /mt/plugins/StructuredBlogging/descriptions or /wp/wpsb-files/microcontent/descriptions Microcontent types and XML formatsIf you are not using PHP or Perl (and can't wait for us to produce a library for you!), here are details on how to interpret the XML files. This will also tell you how to generate editing interfaces and displays for the microcontent formats. MCD: Micro-Content Description file Each microcontent type editable with a Structured Blogging plugin, is defined by an MCD ("micro-content description") file. We’re currently working on a tool to generate schema for the XML that you produce. For the time being, refer to the MCD files for details on the XML formats. Each MCD file has a root element of <micro-content>, under which are two elements: <editor> and <display>. Table: Elements of the MCD file
X-Subnode: Embedding XML in HTMLWhen publishing a piece of microcontent in structured XML form, a method of embedding the XML inside HTML is required. Structured Blogging uses the HTML <script/> tag. X-Subnode is used for two main reasons: 1) We can declare a script type that will both (1) identify the content, and (2) associate it with text content in the HTML page; and 2)It's designed to be ignored by browsers if they can't process the content. Here’s an example: <script type="application/x-subnode; charset=utf-8"> <subnode alternate-for-id="sbentry_1"> ... </subnode> </script> Because the script tag is HTML, we can embed it in the blog page itself - as well as in the ‘description’ and ‘content’ elements of syndication formats. More about the x-Subnode script type The x-subnode script type represents the simplest possible script processing language. It is designed to substitute the enclosed content for the node in the enclosing HTML, with the given tag ID. Most browsers will simply ignore the x-subnode script tag - following the HTML specification that if a browser doesn't have an appropriate language processor, then it can safely ignore a script tag. However if a browser or browser plug-in had a processor for the x-subnode language, it could implement any number of applications on top of the structured content. Here are some examples: · Comparison shopping · Collaborative filtering · Checking tickets · Showtimes · Etc... For reference, a simple XSLT implementation of a script processor will be available for download soon. The purpose of X-Subnode The purpose of the x-subnode script block is to embed valid XML in the HTML content, in a way that is compatible with both HTML and XML and is not displayed or processed by browsers. It is important that the content remain valid XML, so parsing applications can recognize and process it. Therefore the contents can't be escaped or enclosed in an HTML comment. Reference: Old Structured Blogging Schema TypesThe original Structured Blogging plugin published reviews and events using the following schemas. They are retained here for reference, along with an XML schema for the <xml-structured-blog-entry/> element, which is still used. The base type is <xml-structured-blog-entry/>. This type is an envelope or container for the structured blog types; the defined types (for the moment) are <simple-event/> and <simple-review/>. |
Supporters:
For information about joining the initiative contact: info@structuredblogging.org |
© Copyright 2006 StructuredBlogging.org. All rights reserved. |