<?xml version="1.0"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->

<!-- CVS $Id: logicsheet.xsp 433543 2006-08-22 06:22:54Z crossley $ -->

<!-- XSP can be assotiated with the logicsheet using processing
     instruction xml-logicsheet or the xsp:logicsheet element.
     Do not use both methods!

<?xml-logicsheet href="logicsheets/hello.xsl"?>

-->

<xsp:page language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:xsp-hello="http://apache.org/xsp/hello/1.0">

  <xsp:logicsheet location="logicsheets/hello.xsl"/>

  <!-- Context URL also can be used:

  <xsp:logicsheet location="context://samples/xsp/logicsheets/hello.xsl"/>

     URL relative to the current sitemap CAN NOT be used, as 
     logicsheet is the global object, shared between all sitemaps.
  -->

  <page>
    <title>Greetings Page</title>
    <content>
      <xsp:logic>
        String name = <xsp-hello:get-name/>;
        if (name == null) {
          <para>
            <!-- Print default greeting -->
            <xsp-hello:greeting name="Unknown"/>
            <form action="logicsheet">
              Please enter your name: <input name="name"/> <input type="submit"/>
            </form>
          </para>
        } else {
          <para>
            <!-- Override default greeting -->
            <xsp-hello:greeting value="Welcome to this small logicsheet sample">
              <!-- Alternate way of specifying name attribute -->
              <xsp-hello:name><xsp:expr>name</xsp:expr></xsp-hello:name>
            </xsp-hello:greeting>
          </para>

          <para>
            This greeting above was created using simple logicsheet.
          </para>
        }
      </xsp:logic>
    </content>
  </page>
</xsp:page>
