some fixes for reading in default values for checkboxes and dates. checking in some of my test xsds and xsls.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3908 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Ariel Backenroth
2006-09-24 16:51:47 +00:00
parent de3e2ef435
commit 069649c8ed
21 changed files with 925 additions and 6 deletions

View File

@@ -0,0 +1,6 @@
<note important="true">
<to>me</to>
<from>you</from>
<subject>this is a very important note</subject>
<body>foo</body>
</note>

View File

@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="note">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="from" type="xs:string"/>
<xs:element name="subject" type="xs:string"/>
<xs:element name="body" type="xs:anyType"/>
</xs:sequence>
<xs:attribute name="important" type="xs:boolean"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,61 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml">
<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<html>
<head>
<style type="text/css">
body
{
font-family: Tahoma, Arial, Helvetica, sans-serif;
background-color: white;
font-size: 11px;
}
.name {
color: #003366;
font-weight: bold;
margin-right: 10px;
}
</style>
<title><xsl:value-of select="/note/title"/></title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="/note/to">
<div style="line-height: 25px;"><span class="name">To:</span> <xsl:value-of select="/note/to"/></div>
</xsl:template>
<xsl:template match="/note/from">
<div><span class="name">From:</span> <xsl:value-of select="/note/from"/></div>
</xsl:template>
<xsl:template match="/note/subject">
<div style="position:relative;">
<span class="name">Subject:</span>
<xsl:value-of select="/note/subject"/>
<xsl:choose>
<xsl:when test="/note/@important='true'">
<span style="margin-left:5px;font-size:14px;font-weigh:bold;color:red;">!!!!!</span>
</xsl:when>
</xsl:choose>
</div>
</xsl:template>
<xsl:template match="/note/body">
<div style="width: 50%; height: 250px; border: solid 1px black; margin-top: 15px;">
<tt><xsl:value-of select="/note/subject"/></tt>
</div>
</xsl:template>
<xsl:template match="/note/important">
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,22 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="person">
<xs:complexType>
<xs:sequence>
<xs:element name="image" type="xs:anyURI"/>
<xs:element name="email" minOccurs="1" maxOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="256"/>
<xs:pattern value="[A-Z0-9._]+@[A-Z0-9.\-]+\.[A-Z]{2,4}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="bio" type="xs:anyType" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="title" type="xs:string"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,16 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
targetNamespace="pr"
elementFormDefault="qualified">
<xs:element name="press-release">
<xs:complexType>
<xs:sequence>
<xs:element name="to" type="xs:string"/>
<xs:element name="from" type="xs:string" minOccurs="0"/>
<xs:element name="subject" type="xs:string" maxOccurs="unbounded"/>
<xs:element name="body" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="note2" type="xs:string"/>
</xs:schema>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:simpleType name="genre">
<xs:restriction base="xs:string">
<xs:enumeration value="classical"/>
<xs:enumeration value="jazz"/>
<xs:enumeration value="soul"/>
<xs:enumeration value="blues"/>
<xs:enumeration value="country"/>
<xs:enumeration value="rock"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="record">
<xs:complexType>
<xs:sequence>
<xs:element name="track" minOccurs="1" maxOccurs="unbounded">
<xs:complexType>
<xs:attribute name="title" type="xs:string"/>
<xs:attribute name="length" type="xs:integer"/>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="name" type="xs:string"/>
<xs:attribute name="artist" type="xs:string"/>
<xs:attribute name="genre" type="genre"/>
<xs:attribute name="year" type="xs:gYear"/>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml">
<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<html>
<head>
<style type="text/css">
body
{
font-family: Tahoma, Arial, Helvetica, sans-serif;
background-color: white;
font-size: 11px;
}
.name {
color: #003366;
font-weight: bold;
margin-right: 10px;
}
</style>
<title><xsl:value-of select="/record/@title"/></title>
</head>
<body>
<div><span class="name">Name:</span> <xsl:value-of select="/record/@name"/></div>
<div><span class="name">Artist:</span> <xsl:value-of select="/record/@artist"/></div>
<div><span class="name">Genre:</span> <xsl:value-of select="/record/@genre"/></div>
<div><span class="name">Year:</span> <xsl:value-of select="/record/@year"/></div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,46 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:simpleType name="five_string_values">
<xs:restriction base="xs:string">
<xs:enumeration value="one"/>
<xs:enumeration value="two"/>
<xs:enumeration value="three"/>
<xs:enumeration value="four"/>
<xs:enumeration value="five"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ten_string_values">
<xs:restriction base="xs:string">
<xs:enumeration value="one"/>
<xs:enumeration value="two"/>
<xs:enumeration value="three"/>
<xs:enumeration value="four"/>
<xs:enumeration value="five"/>
<xs:enumeration value="six"/>
<xs:enumeration value="seven"/>
<xs:enumeration value="eight"/>
<xs:enumeration value="nine"/>
<xs:enumeration value="ten"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="components">
<xs:complexType>
<xs:sequence>
<xs:element name="required_textfield" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="optional_textfield" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="prefilled_textfield" type="xs:string" minOccurs="0" maxOccurs="1" default="i am the default value"/>
<xs:element name="integer" type="xs:integer"/>
<xs:element name="positiveInteger" type="xs:positiveInteger"/>
<xs:element name="double" type="xs:double"/>
<xs:element name="date" type="xs:date"/>
<xs:element name="radio" type="five_string_values"/>
<xs:element name="combobox" type="ten_string_values"/>
<xs:element name="textarea" type="xs:anyType"/>
<xs:element name="checkbox_default_true" type="xs:boolean" default="true"/>
<xs:element name="checkbox_default_false" type="xs:boolean" default="false"/>
<xs:element name="checkbox_no_default" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml">
<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<html>
<head>
<style type="text/css">
body
{
font-family: Tahoma, Arial, Helvetica, sans-serif;
background-color: white;
font-size: 11px;
}
.name {
color: #003366;
font-weight: bold;
margin-right: 10px;
}
</style>
<title>Component Test</title>
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="/components/required_textfield">
<div style="line-height: 25px;"><span class="name">Required Textfield:</span> <xsl:value-of select="/components/required_textfield"/></div>
</xsl:template>
<xsl:template match="/components/optional_textfield">
<div style="line-height: 25px;"><span class="name">Optional Textfield:</span> <xsl:value-of select="/components/optional_textfield"/></div>
</xsl:template>
<xsl:template match="/components/integer">
<div style="line-height: 25px;"><span class="name">Integer:</span> <xsl:value-of select="/components/integer"/></div>
</xsl:template>
<xsl:template match="/components/positiveInteger">
<div style="line-height: 25px;"><span class="name">Positive Integer:</span> <xsl:value-of select="/components/positiveInteger"/></div>
</xsl:template>
<xsl:template match="/components/double">
<div style="line-height: 25px;"><span class="name">Double:</span> <xsl:value-of select="/components/double"/></div>
</xsl:template>
<xsl:template match="/components/date">
<div style="line-height: 25px;"><span class="name">Date:</span> <xsl:value-of select="/components/date"/></div>
</xsl:template>
<xsl:template match="/components/radio">
<div style="line-height: 25px;"><span class="name">Radio:</span> <xsl:value-of select="/components/radio"/></div>
</xsl:template>
<xsl:template match="/components/combobox">
<div style="line-height: 25px;"><span class="name">ComboBox:</span> <xsl:value-of select="/components/combobox"/></div>
</xsl:template>
<xsl:template match="/components/textarea">
<div style="line-height: 25px;"><span class="name">TextArea:</span> <xsl:value-of select="/components/textarea"/></div>
</xsl:template>
<xsl:template match="/components/checkbox">
<div style="line-height: 25px;"><span class="name">CheckBox:</span> <xsl:value-of select="/components/checkbox"/></div>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,42 @@
<!--
Copyright 2004 The Apache Software Foundation
Licensed 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.
-->
<xs:schema targetNamespace="http://xmlbeans.apache.org/samples/datetime"
xmlns:xs = "http://www.w3.org/2001/XMLSchema"
xmlns:dt = "http://xmlbeans.apache.org/samples/datetime"
elementFormDefault="qualified" >
<xs:element name="datetime">
<xs:complexType>
<xs:sequence>
<xs:element name="important-date" type="dt:important-date" minOccurs="1" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="important-date" >
<xs:sequence>
<xs:element name="holiday" type="xs:date" minOccurs="0" maxOccurs="unbounded" />
<xs:element name="fun-begin-time" type="xs:time" minOccurs="1" maxOccurs="1" />
<xs:element name="fun-end-time" type="xs:time" minOccurs="1" maxOccurs="1" />
<xs:element name="job-duration" type="xs:duration" minOccurs="1" maxOccurs="1" />
<xs:element name="birthdatetime" type="xs:dateTime" minOccurs="1" maxOccurs="1" />
<xs:element name="payday" type="xs:gDay" minOccurs="1" maxOccurs="1" />
<xs:element name="description" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:schema>

View File

@@ -0,0 +1,10 @@
<default-values>
<string>default string value</string>
<integer>3</integer>
<date>1978-08-08</date>
<radio>three</radio>
<combobox>three</combobox>
<textarea>default string value</textarea>
<checkbox_default_true>true</checkbox_default_true>
<checkbox_default_false>false</checkbox_default_false>
</default-values>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:simpleType name="five_string_values">
<xs:restriction base="xs:string">
<xs:enumeration value="one"/>
<xs:enumeration value="two"/>
<xs:enumeration value="three"/>
<xs:enumeration value="four"/>
<xs:enumeration value="five"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ten_string_values">
<xs:restriction base="xs:string">
<xs:enumeration value="one"/>
<xs:enumeration value="two"/>
<xs:enumeration value="three"/>
<xs:enumeration value="four"/>
<xs:enumeration value="five"/>
<xs:enumeration value="six"/>
<xs:enumeration value="seven"/>
<xs:enumeration value="eight"/>
<xs:enumeration value="nine"/>
<xs:enumeration value="ten"/>
</xs:restriction>
</xs:simpleType>
<xs:element name="default-values">
<xs:complexType>
<xs:sequence>
<xs:element name="string" type="xs:string" default="default string value"/>
<xs:element name="integer" type="xs:integer" default="3"/>
<xs:element name="date" type="xs:date" default="1978-08-08"/>
<xs:element name="radio" type="five_string_values" default="three"/>
<xs:element name="combobox" type="ten_string_values" default="three"/>
<xs:element name="textarea" type="xs:anyType" default="default string value"/>
<xs:element name="checkbox_default_true" type="xs:boolean" default="true"/>
<xs:element name="checkbox_default_false" type="xs:boolean" default="false"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml">
<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,47 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:simpleType name="five_string_values">
<xs:restriction base="xs:string">
<xs:enumeration value="one"/>
<xs:enumeration value="two"/>
<xs:enumeration value="three"/>
<xs:enumeration value="four"/>
<xs:enumeration value="five"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="ten_string_values">
<xs:restriction base="xs:string">
<xs:enumeration value="one"/>
<xs:enumeration value="two"/>
<xs:enumeration value="three"/>
<xs:enumeration value="four"/>
<xs:enumeration value="five"/>
<xs:enumeration value="six"/>
<xs:enumeration value="seven"/>
<xs:enumeration value="eight"/>
<xs:enumeration value="nine"/>
<xs:enumeration value="ten"/>
</xs:restriction>
</xs:simpleType>
<xs:complexType name="multi-input">
<xs:sequence>
<xs:element name="string" type="xs:string"/>
<xs:element name="int" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
<xs:element name="repeat-components">
<xs:complexType>
<xs:sequence>
<xs:element name="zero-to-one" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="one-to-one" type="xs:anyType" minOccurs="1" maxOccurs="1"/>
<xs:element name="one-to-inf" type="xs:date" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="zero-to-inf" type="xs:integer" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="one-to-five" type="five_string_values" minOccurs="1" maxOccurs="5"/>
<xs:element name="zero-to-five" type="ten_string_values" minOccurs="0" maxOccurs="5"/>
<xs:element name="one-to-five-multi" type="multi-input" minOccurs="1" maxOccurs="5"/>
<xs:element name="zero-to-five-multi" type="multi-input" minOccurs="0" maxOccurs="5"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml">
<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<html>
<head>
<title>repeat-components</title>
</head>
<body>
<table border="1">
<tr><th>zero-to-one</th><td colspan="2"><xsl:value-of select="/repeat-components/zero-to-one"/></td></tr>
<tr><th>one-to-one</th><td colspan="2"><xsl:value-of select="/repeat-components/one-to-one"/></td></tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/one-to-inf)"/>
</xsl:attribute>
-->
one-to-inf
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/one-to-inf">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/zero-to-inf)"/>
</xsl:attribute>
-->
zero-to-inf
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/zero-to-inf">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/one-to-five)"/>
</xsl:attribute>
-->
one-to-five
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/one-to-five">
<li colspan="2"><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/zero-to-five)"/>
</xsl:attribute>
-->
zero-to-five
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/zero-to-five">
<li colspan="2"><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/one-to-five-multi)"/>
</xsl:attribute>
-->
one-to-five-multi
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/one-to-five-multi">
<ul>
<li><xsl:value-of select="string"/></li>
<li><xsl:value-of select="int"/></li>
</ul>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/zero-to-five-multi)"/>
</xsl:attribute>
-->
zero-to-five-multi
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/zero-to-five-multi">
<li>
<ul>
<li><xsl:value-of select="string"/></li>
<li><xsl:value-of select="int"/></li>
</ul>
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,15 @@
<repeat-simple>
<zero-to-one>021</zero-to-one>
<one-to-one>121</one-to-one>
<one-to-inf>12inf-0</one-to-inf>
<one-to-inf>12inf-1</one-to-inf>
<one-to-inf>12inf-2</one-to-inf>
<zero-to-inf>02inf-0</zero-to-inf>
<one-to-five>125-0</one-to-five>
<one-to-five>125-1</one-to-five>
<one-to-five>125-2</one-to-five>
<zero-to-five>025-2</zero-to-five>
<one-to-five-multi><string>125m-s-0</string><int>125m-i-0</int></one-to-five-multi>
<one-to-five-multi><string>125m-s-1</string><int>125m-i-1</int></one-to-five-multi>
<zero-to-five-multi><string>025m-s-0</string><int>025m-i-0</int></zero-to-five-multi>
</repeat-simple>

View File

@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:complexType name="multi-input">
<xs:sequence>
<xs:element name="string" type="xs:string"/>
<xs:element name="int" type="xs:int"/>
</xs:sequence>
</xs:complexType>
<xs:element name="repeat-simple">
<xs:complexType>
<xs:sequence>
<xs:element name="zero-to-one" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="one-to-one" type="xs:string" minOccurs="1" maxOccurs="1"/>
<xs:element name="one-to-inf" type="xs:string" minOccurs="1" maxOccurs="unbounded"/>
<xs:element name="zero-to-inf" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="one-to-five" type="xs:string" minOccurs="1" maxOccurs="5"/>
<xs:element name="zero-to-five" type="xs:string" minOccurs="0" maxOccurs="5"/>
<xs:element name="one-to-five-multi" type="multi-input" minOccurs="1" maxOccurs="5"/>
<xs:element name="zero-to-five-multi" type="multi-input" minOccurs="0" maxOccurs="5"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml">
<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<html>
<head>
<title>repeat-simple</title>
</head>
<body>
<table border="1">
<tr><th>zero-to-one</th><td colspan="2"><xsl:value-of select="/repeat-simple/zero-to-one"/></td></tr>
<tr><th>one-to-one</th><td colspan="2"><xsl:value-of select="/repeat-simple/one-to-one"/></td></tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-simple/one-to-inf)"/>
</xsl:attribute>
-->
one-to-inf
</th>
<td>
<ul>
<xsl:for-each select="/repeat-simple/one-to-inf">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-simple/zero-to-inf)"/>
</xsl:attribute>
-->
zero-to-inf
</th>
<td>
<ul>
<xsl:for-each select="/repeat-simple/zero-to-inf">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-simple/one-to-five)"/>
</xsl:attribute>
-->
one-to-five
</th>
<td>
<ul>
<xsl:for-each select="/repeat-simple/one-to-five">
<li colspan="2"><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-simple/zero-to-five)"/>
</xsl:attribute>
-->
zero-to-five
</th>
<td>
<ul>
<xsl:for-each select="/repeat-simple/zero-to-five">
<li colspan="2"><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-simple/one-to-five-multi)"/>
</xsl:attribute>
-->
one-to-five-multi
</th>
<td>
<ul>
<xsl:for-each select="/repeat-simple/one-to-five-multi">
<ul>
<li><xsl:value-of select="string"/></li>
<li><xsl:value-of select="int"/></li>
</ul>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-simple/zero-to-five-multi)"/>
</xsl:attribute>
-->
zero-to-five-multi
</th>
<td>
<ul>
<xsl:for-each select="/repeat-simple/zero-to-five-multi">
<li>
<ul>
<li><xsl:value-of select="string"/></li>
<li><xsl:value-of select="int"/></li>
</ul>
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="textarea-test">
<xs:complexType>
<xs:sequence>
<xs:element name="textarea" type="xs:anyType" minOccurs="0" maxOccurs="1"/>
<xs:element name="repeating-textarea" type="xs:anyType" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xhtml="http://www.w3.org/1999/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xhtml">
<xsl:output method="html" version="4.01" encoding="UTF-8" indent="yes"
doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
<xsl:preserve-space elements="*"/>
<xsl:template match="/">
<html>
<head>
<title>repeat-components</title>
</head>
<body>
<table border="1">
<tr><th>zero-to-one</th><td colspan="2"><xsl:value-of select="/repeat-components/zero-to-one"/></td></tr>
<tr><th>one-to-one</th><td colspan="2"><xsl:value-of select="/repeat-components/one-to-one"/></td></tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/one-to-inf)"/>
</xsl:attribute>
-->
one-to-inf
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/one-to-inf">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/zero-to-inf)"/>
</xsl:attribute>
-->
zero-to-inf
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/zero-to-inf">
<li><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/one-to-five)"/>
</xsl:attribute>
-->
one-to-five
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/one-to-five">
<li colspan="2"><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/zero-to-five)"/>
</xsl:attribute>
-->
zero-to-five
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/zero-to-five">
<li colspan="2"><xsl:value-of select="."/></li>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/one-to-five-multi)"/>
</xsl:attribute>
-->
one-to-five-multi
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/one-to-five-multi">
<ul>
<li><xsl:value-of select="string"/></li>
<li><xsl:value-of select="int"/></li>
</ul>
</xsl:for-each>
</ul>
</td>
</tr>
<tr>
<th>
<!--
<xsl:attribute name="rowspan">
<xsl:value-of select="count(/repeat-components/zero-to-five-multi)"/>
</xsl:attribute>
-->
zero-to-five-multi
</th>
<td>
<ul>
<xsl:for-each select="/repeat-components/zero-to-five-multi">
<li>
<ul>
<li><xsl:value-of select="string"/></li>
<li><xsl:value-of select="int"/></li>
</ul>
</li>
</xsl:for-each>
</ul>
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>

View File

@@ -145,7 +145,8 @@ dojo.declare("alfresco.xforms.DatePicker",
},
render: function(attach_point)
{
var initial_value = this.getInitialValue() || dojo.widget.DatePicker.util.toRfcDate();
var initial_value = this.getInitialValue();
var dateTextBoxDiv = document.createElement("div");
attach_point.appendChild(dateTextBoxDiv);
this.dateTextBox = dojo.widget.createWidget("DateTextBox",
@@ -160,12 +161,17 @@ dojo.declare("alfresco.xforms.DatePicker",
"onfocus",
this,
this._dateTextBox_focusHandler);
var datePickerDiv = document.createElement("div");
attach_point.appendChild(datePickerDiv);
var dp_initial_value = (initial_value
? initial_value
: dojo.widget.DatePicker.util.toRfcDate(new Date()));
this.dateTextBox.picker = dojo.widget.createWidget("DatePicker",
{
isHidden: true,
value : initial_value
storedDate: dp_initial_value
},
datePickerDiv);
this.dateTextBox.picker.hide();
@@ -355,7 +361,7 @@ dojo.declare("alfresco.xforms.Select1",
}
});
dojo.declare("alfresco.xforms.CheckBox",
dojo.declare("alfresco.xforms.Checkbox",
alfresco.xforms.Widget,
{
initializer: function(xform, node)
@@ -366,8 +372,8 @@ dojo.declare("alfresco.xforms.CheckBox",
{
var nodeRef = document.createElement("div");
attach_point.appendChild(nodeRef);
var initial_value = this.getInitialValue() || false;
this.widget = dojo.widget.createWidget("CheckBox",
var initial_value = this.getInitialValue() == "true";
this.widget = dojo.widget.createWidget("Checkbox",
{
widgetId: this.id + "-widget",
checked: initial_value
@@ -1070,7 +1076,7 @@ function create_widget(xform, node)
}
case "xforms:select1":
return (xform.getType(node) == "boolean"
? new alfresco.xforms.CheckBox(xform, node)
? new alfresco.xforms.Checkbox(xform, node)
: new alfresco.xforms.Select1(xform, node));
case "xforms:submit":
return new alfresco.xforms.Submit(xform, node);