Welcome Guest, you are in: Login

Daisley-Harrison Software

RSS RSS

Navigation




Search the wiki
»

 

So go to W3 Schools XSLT Tutorial and sharpen your XML transform writting skills, cause with the XlstMarkupPlugin you can create just about any kind of markup you desire.



Layout of a Xslt Markup Processor File

 
<?xml version="1.0" encoding="utf-8"?>

<?markup 
 ... The markup meta-data goes here..
?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
    xmlns:wiki="http://daisley-harrison.com/namespaces/screwturnwiki/xsltmarkupplugin/wiki-context"
    xmlns:http=http://daisley-harrison.com/namespaces/screwturnwiki/xsltmarkupplugin/http-context"
    xmlns:data=http://daisley-harrison.com/namespaces/screwturnwiki/xsltmarkupplugin/data-access">

  <xsl:output method="html" indent="yes"/>
  <xsl:param name="match-number"/>
  <xsl:param name="base-uri"/>
  
 
   ... any additional named or unnamed parameters to be used are defined here...
 
  <xsl:template match="/">

    ... all xslt instructions to process the markup namespace goes here...

  </xsl:template>

</xsl:stylesheet>


 

 

Markup Meta-Data

Markup meta data is defined in a special processing-instruction that must appear at the top of your Xslt file.


<?markup 
 ... The markup meta-data goes here..
?>



The presents of the markup processing-instruction is how the XsltMarkupPlugin knows that the xlst file contains a valid Xslt Markup Processor.

Markup meta-data is defined inside the <?markup ... ?> processing-instruction using commands that conform to the following syntax:


[ command ...";" [ command ... ";" [ command ... ";" ] ... ] ]


All markup meta data command must be terminated with a semi-colon.

Values are specified in meta-data commands with the following syntax:


identifier

or

"enclosed text with whitespace"

or

'enclosed text with whitespace'

or


{enclosed text with whitespace}


Where:

  • identifier is any string of letters or digits (including hyphen or underline) that does not contain any whitespace.
  • text enclosed in double quote characters can include double quote characters if there are immediate followed by another double quote character ( i.e. "").
  • text enclosed in single quote characters can include single quote characters if there are immediate followed by another single quote character ( i.e. '').
  • text enclosed in parenthesis can include opening parenthesis characters, but closing parenthesis character must be immediate followed by another closing parenthesis ( i.e. }}).

The following meta-data commands are available:

namespace

The namespace command MUST be present in the markup processing-instruction, all other commands are optional.

"namespace" markup-namespace ";"


Where

  • markup-namespace is the name of the markup namespace being defined.

syntax

The syntax command sets the syntax used by the markup namespace.

"syntax" { wiki | xml }";"


Where

  • wiki - indicates that the wiki form of markup syntax will be used (this is the default setting).
  • xml - indicates that the xml form of markup syntax will be used.

please see XsltMarkup Plugin for the support syntax defined.

formatting-phase

The formatting-phase command MUST be present in the markup processing-instruction, all other commands are optional.

"formatting-phase" { phase1 | phase2 | phase3 | dynamic } ";"


Where

  • phase1 - markup processing occurs before standard wiki markup is processed
  • phase2 - markup processing occurs after standard wiki markup is processed
  • phase3 - markup processin occurs just before the page is displayed ( and each time the page is displayed).
  • dynamic - Same as specifying "phase3".

title

Set the title of the markup processor.


"title" value ";"


Where

  • value is the text of the title (refer the syntax for values above).

example

Set the example of the markup processor.


"example" value ";"


Where

  • value is the text of the example (refer the syntax for values above).

usage

Set the usage text of the markup processor.


"usage" value ";"


Where

  • value is the text of the usage (refer the syntax for values above).

description

Set the description of the markup processor.


"description" value ";"


Where

  • value is the text of the description (refer the syntax for values above).

author

Set the author of the markup processor.


"author" value ";"


Where

  • value is the text of the author (refer the syntax for values above).

support-url

Set the support url of the markup processor.


"support-url" value ";"


Where

  • value is the text of the support-url (refer the syntax for values above).

license

Set the license of the markup processor.


"license" value ";"


Where

  • value is the text of the license (refer the syntax for values above).

copyright

Set the copyright of the markup processor.


"copyright" value ";"


Where

  • value is the text of the copyright (refer the syntax for values above).

grant

Grants permission to one or more user groups for the use of this markup namespace. If the meta-data contains a grant command, only those user-groups specified are granted permission for the markup namespace, all others are denied. If no grant command is present, then by default all user-groups have premission for the markup namespace.


"grant" group-name [ "," group-name ] ["," group-name ] ... ";"


Where

  • group-name is the group-name to be granted permission for this markup namespace (group-names can be enclosed in quotes, refer the syntax for values above).

deny

Deny permission to one or more user groups for the use of this markup namespace. Denied groups are combined with grantted groups to determine the effective permission of a user. Note that users belonging to a denied group are denied access even though they may belong on other user-groups that have permission.

It is NOT possible to deny access to the Administrators group.


"deny" group-name [ "," group-name ] ["," group-name ] ... ";"


Where

  • group-name is the group-name to be denied permission for this markup namespace (group-names can be enclosed in quotes, refer the syntax for values above).



Markup Namespace Definitions

The following namespaces should be configured for an Xslt Markup Processor:


    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
    xmlns:wiki="http://daisley-harrison.com/namespaces/screwturnwiki/xsltmarkupplugin/wiki-context"
    xmlns:http=http://daisley-harrison.com/namespaces/screwturnwiki/xsltmarkupplugin/http-context"
    xmlns:data=http://daisley-harrison.com/namespaces/screwturnwiki/xsltmarkupplugin/data-access"


Where:
  • xsl - is the xsl stylesheet namespace
  • msxsl - the microsoft xsl namespace gives access to some additional functionality specific to microsoft xslt engine.
  • wiki - the wiki-context namespace gives access to the ScrewTurn Wiki API.
  • http - the http-context namespace gives access to the IIS HTTP namespace.
  • data - the data-access namespace gives access to .NET DataProviders (Access to SQL and ODBC etc.).

Markup Parameter Definitions

If you are using the wiki syntax then parameters are parsed from the markup into named and unnamed parameters, then these parameters are passed to the xslt stylesheet as standard stylesheet parameters.

  • Named parameters (specified in the markup as name=value pairs) are passed to the stylesheet with the parameter name specified.
  • Unnamed parameters are passed to the stylesheet using the name series "unnamed-parameter-0" , "unnamed-parameter-1", "unnamed-parameter-2", ... "unnamed-parameter-n";

The entire set of parameters is also available to the stylesheet through the wiki-context namespace, via the wiki:XsltMarkupParameters() function.

Markup Processor Template

If you are using the wiki syntax then there is only one template to be defined in the stylesheet. Use the root template <xsl:template match="/"> ... </xsl:template> to wrap your procssing command in.

If you are using the xml syntax then the full power of the xslt stylesheet can be used. The entire matching markup is parsed into the source xml document and is supplied to the xslt stylesheet for processing.

Xslt Quick Reference

W3 Schools XSLT Quick Reference

The wiki-context namespace

Please see XSLT wiki-context Namespace for more details

The http-context namespace

Please see XSLT http-context Namespace for more details

The data-access namespace

Please see data-access namespace for more details.





Please visit our blog at http://blog.daisley-harrison.com

- All Content © Copyright 2010 Daisley-Harrison Software - All Rights Reserved. - ScrewTurn Wiki version 3.0.1.400.