Template:— representing_date_time (rep_date_time) Date: 2008/03/04 23:11:32
Revision: 1.17
Template: representing_date_time

XML references to the Template

These can be cut and pasted into the XML as required.

representing_date_time

Set up a hyperlink to the template definition.
<template_ref name="representing_date_time" capability="assigning_date_time"/>

Set up a table of the template parameters.
<template_table figure_id="?" instance="" name="representing_date_time" capability="assigning_date_time">
  <param name="year">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="month">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="day">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="hour">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="minute">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="second">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="sense">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="hour_offset">
    <param_value></param_value>
    <description></description>
  </param>
  <param name="minute_offset">
    <param_value></param_value>
    <description></description>
  </param>
</template_table>

Setup a template_example:
<template_example name="representing_date_time">
  <param_in name="year" value=""/>
  <param_in name="month" value=""/>
  <param_in name="day" value=""/>
  <param_in name="hour" value=""/>
  <param_in name="minute" value=""/>
  <param_in name="second" value=""/>
  <param_in name="sense" value=""/>
  <param_in name="hour_offset" value=""/>
  <param_in name="minute_offset" value=""/>
</template_example>

representing_date_time
/representing_date_time(year='', month='', day='', hour='', minute='', second='', sense='', hour_offset='', minute_offset='')/

Path

-- Instantiate Date_time entity
Date_time

-- Bind the Date_time to the parameter ^date_time.
-- The parameter is a reference parameter so the Date_time
-- entity can be referred to when this template is used.
%^date_time = Date_time%

-- Instantiate Calendar_date and point at it
Date_time.date_component -> Calendar_date

-- Instantiate Local_time and point at it
Date_time.time_component -> Local_time

-- Instantiate Time_offset and point at it
Local_time.zone -> Time_offset

-- Bind the Time_offset to the parameter ^time_offset.
-- The parameter is a reference parameter so the Time_offset
-- entity can be referred to when this template is used.
%^time_offset = Time_offset%

-- Set the Calendar_date attributes
Calendar_date.year_component -> @year
Calendar_date.month_component -> @month
Calendar_date.day_component -> @day

-- Bind the Calendar_date to the parameter ^calendar_date.
-- The parameter is a reference parameter so the Calendar_date
-- entity can be referred to when this template is used.
%^calendar_date = Calendar_date%

-- Set the Local_time attributes
Local_time.hour_component -> @hour
Local_time.minute_component -> @minute
Local_time.second_component -> @second

-- Set the Time_offset attributes
Time_offset.sense -> @sense
Time_offset.hour_offset -> @hour_offset
Time_offset.minute_offset -> @minute_offset

XML representation of path

<refpath
   template="representing_date_time">
   <comment>
      Instantiate Date_time entity
   </comment>
   <instantiate
      entity="Date_time"
      context="">
      
   </instantiate>
   <comment>
      Bind the Date_time to the parameter ^date_time.
   </comment>
   <comment>
      The parameter is a reference parameter so the Date_time
   </comment>
   <comment>
      entity can be referred to when this template is used.
   </comment>
   <bind
      parameter="date_time">
      <express_entity
         entity="Date_time"
         context="">
         
      </express_entity>
   </bind>
   <comment>
      Instantiate Calendar_date and point at it
   </comment>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Date_time"
            attribute="date_component"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <express_entity
            entity="Calendar_date"
            context="">
            
         </express_entity>
      </source>
   </assign>
   <comment>
      Instantiate Local_time and point at it
   </comment>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Date_time"
            attribute="time_component"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <express_entity
            entity="Local_time"
            context="">
            
         </express_entity>
      </source>
   </assign>
   <comment>
      Instantiate Time_offset and point at it
   </comment>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Local_time"
            attribute="zone"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <express_entity
            entity="Time_offset"
            context="">
            
         </express_entity>
      </source>
   </assign>
   <comment>
      Bind the Time_offset to the parameter ^time_offset.
   </comment>
   <comment>
      The parameter is a reference parameter so the Time_offset
   </comment>
   <comment>
      entity can be referred to when this template is used.
   </comment>
   <bind
      parameter="time_offset">
      <express_entity
         entity="Time_offset"
         context="">
         
      </express_entity>
   </bind>
   <comment>
      Set the Calendar_date attributes
   </comment>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Calendar_date"
            attribute="year_component"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="year">
            
         </param_in_ref>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Calendar_date"
            attribute="month_component"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="month">
            
         </param_in_ref>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Calendar_date"
            attribute="day_component"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="day">
            
         </param_in_ref>
      </source>
   </assign>
   <comment>
      Bind the Calendar_date to the parameter ^calendar_date.
   </comment>
   <comment>
      The parameter is a reference parameter so the Calendar_date
   </comment>
   <comment>
      entity can be referred to when this template is used.
   </comment>
   <bind
      parameter="calendar_date">
      <express_entity
         entity="Calendar_date"
         context="">
         
      </express_entity>
   </bind>
   <comment>
      Set the Local_time attributes
   </comment>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Local_time"
            attribute="hour_component"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="hour">
            
         </param_in_ref>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Local_time"
            attribute="minute_component"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="minute">
            
         </param_in_ref>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Local_time"
            attribute="second_component"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="second">
            
         </param_in_ref>
      </source>
   </assign>
   <comment>
      Set the Time_offset attributes
   </comment>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Time_offset"
            attribute="sense"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="sense">
            
         </param_in_ref>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Time_offset"
            attribute="hour_offset"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="hour_offset">
            
         </param_in_ref>
      </source>
   </assign>
   <assign
      assignment_type="points-to">
      <target>
         <express_attribute
            entity="Time_offset"
            attribute="minute_offset"
            context="">
            
         </express_attribute>
      </target>
      <source>
         <param_in_ref
            name="minute_offset">
            
         </param_in_ref>
      </source>
   </assign>
</refpath>

© OASIS 2010 — All rights reserved