o2xdl-core samples  3.01
Functions
minimal_object03.o2xSobj File Reference

Minimal o2x:object - 3: tests CDATA section. More...

Functions

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

Detailed Description

This is a small o2x:object for CDATA test. An alternative way to include the XML data or XSLT code.

data
Data is defined by value, i.e. using a CDATA section into the <o2x:body> tag.
methods
The unique method is defined by value, using a CDATA section into the <o2x:inline> tag.
Returns
An HTML fragment: the ship address formatted to print.

Function Documentation

◆ XML_code()

XML_code ( )

Implementation: data and method inline using CDATA.

Note
  • In CDATA XSLT section you MUST declare xsl namespace.


-<o2x:object name="minimal_object03" xmlns:o2x="http://www.o2xdl.org/3.0/o2xdl" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
-<o2x:dataValues>
<o2x:body> <shipTo country="US"> <name>Kim Yoshida</name> <street>123 Maple Street</street> <city>Mill Valley</city> <state>CA</state> <zip>90952</zip> </shipTo> </o2x:body>
</o2x:dataValues>
-<o2x:method key="OBJ.050511.M01">
<o2x:inline> <xsl:output omit-xml-declaration="yes" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" /> <!-- standard public method template --> <xsl:template match="o2x:object[@key = 'OBJ.050511.M01']/shipTo" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > <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> </o2x:inline>
</o2x:method>
</o2x:object>