o2xdl-core samples  3.01
Functions
minimal_object04.o2xSobj File Reference

Minimal o2x:object - 4: tests stylesheet/transform tags. More...

Functions

 XML_code ()
 o2x:object code. More...
 

Detailed Description

This is a small o2x:object for <xsl:stylesheet> tag test.

data
Data is defined by reference, i.e. using a local file defined by URIref attribute in <o2x:dataValues> tag.
methods
The unique method is defined by value, using a in <o2x:inline> tag with the <xsl:stylesheet> tag.
Returns
An HTML fragment: the ship address formatted to print.

Function Documentation

◆ XML_code()

XML_code ( )

Implementation: data on remote file, method inline using stylesheet tag.

CORE constraint
o2x:method: In all o2x:methods the <xsl:stylesheet>|<xsl:transform> tag is optional. A <o2x:method is a collection of <xsl:template>
  • When the method is implemented as a file, and not by value, the tag <xsl:stylesheet> can be useful to test the method standalone.


-<o2x:object name="minimal_object04" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:o2x="http://www.o2xdl.org/3.0/o2xdl">
<o2x:dataValues URIref="file:////C:/o2xdl-20/samples/minimal_object02_data.xml"/>
-<o2x:method key="OBJ.050511.M01">
-<o2x:inline>
-<xsl:stylesheet>
-<!--
 standard final binding 
-->
-<xsl:template match="o2x:object[@key = 'OBJ.050511.M01']/shipTo">
-<b>
<xsl:value-of select="name"/>
</b>
<br/>
<xsl:value-of select="street"/>
<br/>
<xsl:value-of select="city"/>
,
<xsl:value-of select="state"/>
<xsl:value-of select="zip"/>
<br/>
<xsl:value-of select="@country"/>
</xsl:template>
</xsl:stylesheet>
</o2x:inline>
</o2x:method>
</o2x:object>