| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| /* |
| * 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. |
| */ |
| --> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-us"> |
| <head> |
| <title>Seedsnipe - Simple templating language</title> |
| <link rel="stylesheet" type="text/css" href="style/documentation.css"/> |
| </head> |
| <body> |
| <h1>Seedsnipe - Simple templating languag</h1> |
| |
| <p>Seedsnipe is meant to be easy and higly intuitive, so a couple of examples should do :).</p> |
| |
| <p>A nested loop, at least one of the variables is an array of two (or more) dimenstions. </p> |
| <div class="blockcode"> |
| ${loop} |
| ${loop} |
| a variable: ${var1} |
| another variable: ${var2} |
| ${/loop} |
| ${/loop} |
| </div> |
| |
| <p>Display a foaf:PersonalProfileDocument (as HTML snippet):</p> |
| <div class="blockcode"> |
| ${loop} |
| Name: ${foaf:primaryTopic/foaf:name}<br /> |
| Phone: ${foaf:primaryTopic/foaf:phone}<br /> |
| Friends:<br/> |
| ${loop} |
| ${loop} |
| ${if foaf:primaryTopic/foaf:knows/rdf:type="<http://xmlns.com/foaf/0.1/Person>"} |
| Person: |
| ${else} |
| Agent: |
| ${/if} |
| ${foaf:primaryTopic/foaf:knows/foaf:name} <br/> |
| ${/loop} |
| ${/loop} |
| ${/loop} |
| </div> |
| <p>Sorting loops in acsending and descending order:</p> |
| <div class="blockcode"> |
| ${loop sort desc outer} |
| ${loop sort asc inner} |
| a variable: ${outer} |
| another variable: ${inner} |
| ${/loop} |
| ${/loop} |
| </div> |
| </body> |
| </html> |
| |