Publication Logo
 

Search :

 

XML-ECHO : Examples

 

Simple Parameterization






A Parameterized Script

<e:echo xmlns:e='http://namespaces.xmlecho.org/echo">
   
<e:paramSet>
<e:param name="yourName">Annie</e:param>
</e:paramSet>

<h2>Hello <e:paramRef refParamName="yourName" /></h2>

</e:echo>

produces:

<h2>Hello Annie</h2>

In this example, the h2 is again producing the literal output element "h2" but performs a function call on the ECHO command, paramRef to complete the value of h2's PCDATA contents. The e:param element within the e:paramSet declares that the script will make use of a parameter named "yourName" and gives it a default value.