freemarker-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ddek...@apache.org
Subject [31/51] [abbrv] [partial] incubator-freemarker git commit: Restructured project so that freemarker-test-utils depends on freemarker-core (and hence can provide common classes for testing templates, and can use utility classes defined in the core). As a c
Date Mon, 15 May 2017 21:23:47 GMT
http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-strlitinterpolation.ast
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-strlitinterpolation.ast b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-strlitinterpolation.ast
new file mode 100644
index 0000000..321721e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-strlitinterpolation.ast
@@ -0,0 +1,82 @@
+/*
+ * 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.
+ */
+#mixed_content  // o.a.f.c.ASTImplicitParent
+    #text  // o.a.f.c.ASTStaticText
+        - content: "1. "  // String
+    @  // o.a.f.c.ASTDirUserDefined
+        - callee: m  // o.a.f.c.ASTExpVariable
+        - argument name: "x"  // String
+        - argument value: dynamic "..."  // o.a.f.c.ASTExpStringLiteral
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: e1  // o.a.f.c.ASTExpVariable
+        - argument name: "y"  // String
+        - argument value: "$\\{e2}"  // o.a.f.c.ASTExpStringLiteral
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n2. "  // String
+    ${...}  // o.a.f.c.ASTDollarInterpolation
+        - content: dynamic "..."  // o.a.f.c.ASTExpStringLiteral
+            - value part: "a"  // String
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: x  // o.a.f.c.ASTExpVariable
+            - value part: "b"  // String
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: x  // o.a.f.c.ASTExpVariable
+            - value part: "c"  // String
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n3. "  // String
+    ${...}  // o.a.f.c.ASTDollarInterpolation
+        - content: dynamic "..."  // o.a.f.c.ASTExpStringLiteral
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: x  // o.a.f.c.ASTExpVariable
+            - value part: "b"  // String
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n4. "  // String
+    ${...}  // o.a.f.c.ASTDollarInterpolation
+        - content: dynamic "..."  // o.a.f.c.ASTExpStringLiteral
+            - value part: "a"  // String
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: x  // o.a.f.c.ASTExpVariable
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n5. "  // String
+    ${...}  // o.a.f.c.ASTDollarInterpolation
+        - content: dynamic "..."  // o.a.f.c.ASTExpStringLiteral
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: x  // o.a.f.c.ASTExpVariable
+            - value part: #{...}  // o.a.f.c.ASTHashInterpolation
+                - content: y  // o.a.f.c.ASTExpVariable
+                - minimum decimals: "0"  // Integer
+                - maximum decimals: "0"  // Integer
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n6. "  // String
+    ${...}  // o.a.f.c.ASTDollarInterpolation
+        - content: dynamic "..."  // o.a.f.c.ASTExpStringLiteral
+            - value part: "a b "  // String
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: x  // o.a.f.c.ASTExpVariable
+            - value part: " c d"  // String
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n7. "  // String
+    ${...}  // o.a.f.c.ASTDollarInterpolation
+        - content: dynamic "..."  // o.a.f.c.ASTExpStringLiteral
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: x  // o.a.f.c.ASTExpVariable
+            - value part: " a b "  // String
+            - value part: ${...}  // o.a.f.c.ASTDollarInterpolation
+                - content: y  // o.a.f.c.ASTExpVariable
+            - value part: " c$d"  // String

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-strlitinterpolation.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-strlitinterpolation.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-strlitinterpolation.ftl
new file mode 100644
index 0000000..cd86f2f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-strlitinterpolation.ftl
@@ -0,0 +1,25 @@
+<#--
+  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.
+-->
+1. <@m x='${e1}' y='$\\{e2}' />
+2. ${'a${x}b${x}c'}
+3. ${'${x}b'}
+4. ${'a${x}'}
+5. ${'${x}#{y}'}
+6. ${'a b ${x} c d'}
+7. ${'${x} a b ${y} c$d'}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-whitespacestripping.ast
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-whitespacestripping.ast b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-whitespacestripping.ast
new file mode 100644
index 0000000..868fc69
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-whitespacestripping.ast
@@ -0,0 +1,70 @@
+/*
+ * 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.
+ */
+#mixed_content  // o.a.f.c.ASTImplicitParent
+    #assign  // o.a.f.c.ASTDirAssignment
+        - assignment target: "xs"  // String
+        - assignment operator: "="  // String
+        - assignment source: [...]  // o.a.f.c.ASTExpListLiteral
+        - variable scope: "1"  // Integer
+        - namespace: null  // Null
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n"  // String
+    #list  // o.a.f.c.ASTDirList
+        - list source: x  // o.a.f.c.ASTExpVariable
+        - target loop variable: "xs"  // String
+        #text  // o.a.f.c.ASTStaticText
+            - content: "    "  // String
+        ${...}  // o.a.f.c.ASTDollarInterpolation
+            - content: x  // o.a.f.c.ASTExpVariable
+        #text  // o.a.f.c.ASTStaticText
+            - content: "\n"  // String
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n"  // String
+    #assign  // o.a.f.c.ASTDirAssignment
+        - assignment target: "a"  // String
+        - assignment operator: "="  // String
+        - assignment source: 1  // o.a.f.c.ASTExpNumberLiteral
+        - variable scope: "1"  // Integer
+        - namespace: null  // Null
+    #assign  // o.a.f.c.ASTDirAssignment
+        - assignment target: "b"  // String
+        - assignment operator: "="  // String
+        - assignment source: 1  // o.a.f.c.ASTExpNumberLiteral
+        - variable scope: "1"  // Integer
+        - namespace: null  // Null
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n"  // String
+    @  // o.a.f.c.ASTDirUserDefined
+        - callee: b  // o.a.f.c.ASTExpVariable
+        #text  // o.a.f.c.ASTStaticText
+            - content: "    x\n"  // String
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n"  // String
+    @  // o.a.f.c.ASTDirUserDefined
+        - callee: c  // o.a.f.c.ASTExpVariable
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\n"  // String
+    @  // o.a.f.c.ASTDirUserDefined
+        - callee: d  // o.a.f.c.ASTExpVariable
+    #text  // o.a.f.c.ASTStaticText
+        - content: "\na\n"  // String
+    #--...--  // o.a.f.c.ASTComment
+        - content: " comment "  // String
+    #text  // o.a.f.c.ASTStaticText
+        - content: "b"  // String

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-whitespacestripping.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-whitespacestripping.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-whitespacestripping.ftl
new file mode 100644
index 0000000..cba7289
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/ast-whitespacestripping.ftl
@@ -0,0 +1,40 @@
+<#--
+  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.
+-->
+
+
+<#assign xs = []>
+
+<#list x as xs>
+    ${x}
+</#list>
+
+<#assign a = 1>
+<#assign b = 1>
+
+<@b>
+    x
+</@b>
+
+<@c />
+
+<@d></@d>
+
+a
+<#-- comment -->
+b
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-assignments.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-assignments.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-assignments.ftl
new file mode 100644
index 0000000..24c8984
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-assignments.ftl
@@ -0,0 +1,35 @@
+<#ftl stripWhitespace=false>
+<#--
+  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.
+-->
+<#assign x = 1>
+<#assign x = 1, y = 2>
+<#assign x = 1 in ns>
+<#assign x = 1, y = 2 in ns>
+<#assign a += b + c>
+<#assign a += 1, b -= 2, c *= 3, d /= 4, e %= 5, f++, g-->
+<#global x = 1>
+<#global x = 1, y = 2>
+<#global x++>
+<#macro m>
+  <#local x = 1>
+  <#local x = 1, y = 2>
+</#macro>
+<#assign x>
+  foo ${bar}
+</#assign>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-assignments.ftl.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-assignments.ftl.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-assignments.ftl.out
new file mode 100644
index 0000000..3dd2307
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-assignments.ftl.out
@@ -0,0 +1,34 @@
+/*
+ * 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.
+ */
+<#assign x = 1>
+<#assign x = 1, y = 2>
+<#assign x = 1 in ns>
+<#assign x = 1, y = 2 in ns>
+<#assign a += b + c>
+<#assign a += 1, b -= 2, c *= 3, d /= 4, e %= 5, f++, g-->
+<#global x = 1>
+<#global x = 1, y = 2>
+<#global x++>
+<#macro m>
+  <#local x = 1>
+  <#local x = 1, y = 2>
+</#macro>
+<#assign x>
+  foo ${bar}
+</#assign>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-builtins.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-builtins.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-builtins.ftl
new file mode 100644
index 0000000..74aee52
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-builtins.ftl
@@ -0,0 +1,23 @@
+<#--
+  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.
+-->
+${x?trim}
+${x?left_pad(5)}
+${x?left_pad(5, '-')}
+${x?then('y', 'n')}
+${x?switch(1, 11, 2, 22, 33)}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-builtins.ftl.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-builtins.ftl.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-builtins.ftl.out
new file mode 100644
index 0000000..3c62974
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-builtins.ftl.out
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+${x?trim}
+${x?left_pad(5)}
+${x?left_pad(5, "-")}
+${x?then("y", "n")}
+${x?switch(1, 11, 2, 22, 33)}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-identifier-escaping.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-identifier-escaping.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-identifier-escaping.ftl
new file mode 100644
index 0000000..75d52f1
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-identifier-escaping.ftl
@@ -0,0 +1,76 @@
+<#--
+  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.
+-->
+<#macro m\-a data\-color>
+    <#local \.namespace = 123>
+    <a-b>${data\-color}<#nested \.namespace></a-b><#t>
+</#macro>
+<#macro "m-b2"></#macro>
+<#macro "m/b2"></#macro>
+
+<@m\-a data\-color="red"; loop\-var, loopVar2>${loop\-var}</@>
+
+<#function f\-a p\-a>
+    <#return p\-a + " works">
+</#function>
+${f\-a("f-a")}
+
+<#assign \-\-\-\.\: = 'dash-dash-dash etc.'>
+${\-\-\-\.\:}
+${.vars['---.:']}
+<#assign hash = { '--moz-prop': 'propVal' }>
+${hash.\-\-moz\-prop}
+${hash['--moz-prop']}
+
+<#assign ls\:a = 1..3>
+List: <#list ls\:a as \:i>${\:i}</#list>
+
+<#assign sw\-a=1>
+Switch: <#switch sw\-a>
+    <#case 1>OK<#break>
+    <#default>Fails
+</#switch>
+
+<#escape \-x as \-x?upper_case>${'escaped'}</#escape>
+
+<#if false && sw\-a == 1>
+    <#visit x\-y2 using x\-y1>
+    <#recurse x\-y2 using x\-y1>
+    <#import i\-a as i\-b>
+    <#include i\-c>
+</#if>
+
+<#assign @as@_a = 'as1'>
+${@as@_a}
+<#assign 'as-c' = 'as2'>
+${.vars['as-c']}
+<#assign "as/b" = 'as3'>
+${.vars["as/b"]}
+<#assign "as'c" = 'as4'>
+${.vars["as'c"]}
+<#assign 'as"d' = 'as5'>
+${.vars['as"d']}
+
+<#global g\-a=1 g\-b=2 "g-c"=3>
+
+<#macro dumpNS>
+    <#list .namespace?keys?sort as k>
+        ${k} = <#local v = .namespace[k]><#if v?is_string>${v}<#else>...</#if><#lt>
+    </#list>
+</#macro>
+<@dumpNS />

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-identifier-escaping.ftl.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-identifier-escaping.ftl.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-identifier-escaping.ftl.out
new file mode 100644
index 0000000..17e2b4e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-identifier-escaping.ftl.out
@@ -0,0 +1,44 @@
+/*
+ * 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.
+ */
+<#macro m\-a data\-color><#local \.namespace = 123><a-b>${data\-color}<#nested \.namespace></a-b></#macro><#macro m\-b2></#macro><#macro "m/b2"></#macro>
+<@m\-a data\-color="red"; loop\-var, loopVar2>${loop\-var}</@m\-a>
+
+<#function f\-a(p\-a)><#return p\-a + " works"/></#function>${f\-a("f-a")}
+
+<#assign \-\-\-\.\: = "dash-dash-dash etc.">${\-\-\-\.\:}
+${.vars["---.:"]}
+<#assign hash = {"--moz-prop": "propVal"}>${hash.\-\-moz\-prop}
+${hash["--moz-prop"]}
+
+<#assign ls\:a = 1..3>List: <#list ls\:a as \:i>${\:i}</#list>
+
+<#assign sw\-a = 1>Switch: <#switch sw\-a><#case 1>OK<#break/>
+    <#default>Fails
+</#switch>
+<#escape \-x as \-x?upper_case>${"escaped"}</#escape>
+
+<#if false && sw\-a == 1><#visit x\-y2 using x\-y1/><#recurse x\-y2 using x\-y1/><#import i\-a as i\-b/><#include i\-c/></#if>
+<#assign @as@_a = "as1">${@as@_a}
+<#assign as\-c = "as2">${.vars["as-c"]}
+<#assign "as/b" = "as3">${.vars["as/b"]}
+<#assign "as'c" = "as4">${.vars["as'c"]}
+<#assign 'as"d' = "as5">${.vars['as"d']}
+
+<#global g\-a = 1, g\-b = 2, g\-c = 3><#macro dumpNS><#list .namespace?keys?sort as k>${k} = <#local v = .namespace[k]><#if v?is_string>${v}<#else>...</#if>
+</#list></#macro><@dumpNS/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-macros.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-macros.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-macros.ftl
new file mode 100644
index 0000000..9288e63
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-macros.ftl
@@ -0,0 +1,29 @@
+<#ftl stripWhitespace=false>
+<#--
+  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.
+-->
+<#macro m></#macro>
+<#macro m a></#macro>
+<#macro m a b></#macro>
+<#macro m a b c...></#macro>
+<#macro m a...></#macro>
+<#function f()></#function>
+<#function f(a)></#function>
+<#function f(a, b)></#function>
+<#function f(a, b, c...)></#function>
+<#function f(a...)></#function>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-macros.ftl.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-macros.ftl.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-macros.ftl.out
new file mode 100644
index 0000000..ad49cae
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-macros.ftl.out
@@ -0,0 +1,28 @@
+/*
+ * 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.
+ */
+<#macro m></#macro>
+<#macro m a></#macro>
+<#macro m a b></#macro>
+<#macro m a b c...></#macro>
+<#macro m a...></#macro>
+<#function f()></#function>
+<#function f(a)></#function>
+<#function f(a, b)></#function>
+<#function f(a, b, c...)></#function>
+<#function f(a...)></#function>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-strlitinterpolation.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-strlitinterpolation.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-strlitinterpolation.ftl
new file mode 100644
index 0000000..85189a4
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-strlitinterpolation.ftl
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+<@m x='${e1 + "a\'b${x}"}#{x; M2}' y='$\{e2}' />
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-strlitinterpolation.ftl.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-strlitinterpolation.ftl.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-strlitinterpolation.ftl.out
new file mode 100644
index 0000000..754c225
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/cano-strlitinterpolation.ftl.out
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+<@m x="${e1 + \"a'b$\{x}\"}#{x ; m0M2}" y="$\{e2}"/>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/encodingOverride-ISO-8859-1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/encodingOverride-ISO-8859-1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/encodingOverride-ISO-8859-1.ftl
new file mode 100644
index 0000000..e0382c7
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/encodingOverride-ISO-8859-1.ftl
@@ -0,0 +1,20 @@
+<#ftl encoding="ISO-8859-1">
+<#--
+  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.
+-->
+B�ka
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/encodingOverride-UTF-8.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/encodingOverride-UTF-8.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/encodingOverride-UTF-8.ftl
new file mode 100644
index 0000000..5948e30
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/encodingOverride-UTF-8.ftl
@@ -0,0 +1,20 @@
+<#ftl 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.
+-->
+Béka
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templateresolver/test.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templateresolver/test.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templateresolver/test.ftl
new file mode 100644
index 0000000..fb3f45d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/templateresolver/test.ftl
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+dummy
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/toCache1.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/toCache1.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/toCache1.ftl
new file mode 100644
index 0000000..462f1ae
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/toCache1.ftl
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+Template 1
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/core/toCache2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/core/toCache2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/toCache2.ftl
new file mode 100644
index 0000000..f59424c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/core/toCache2.ftl
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+Template 2
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/dom/DOMSiblingTest.xml
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/dom/DOMSiblingTest.xml b/freemarker-core-test/src/test/resources/org/apache/freemarker/dom/DOMSiblingTest.xml
new file mode 100644
index 0000000..d1fe3dc
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/dom/DOMSiblingTest.xml
@@ -0,0 +1,31 @@
+<?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.
+-->
+<person>
+    <gender>male</gender>
+    <name>pradeep</name>
+    <dob>12th August</dob><address>Chennai, India</address>
+    <!--This is a comment Node -->
+    <?xml-stylesheet type="text/css" href="style.css"?>
+    <profession>Software Engineer</profession>
+    <![CDATA[    ]]>
+    <hobby>gardening</hobby>
+    <![CDATA[this is a valid cdata]]>
+    <phone>12345678</phone>
+</person>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-capture.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-capture.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-capture.ftlh
new file mode 100644
index 0000000..24bd0ee
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-capture.ftlh
@@ -0,0 +1,21 @@
+<#--
+  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.
+-->
+<#assign captured><b>Test</b></#assign>
+Just a string: ${"<b>Test</b>"}
+Captured output: ${captured}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-capture.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-capture.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-capture.ftlh.out
new file mode 100644
index 0000000..cf0da7e
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-capture.ftlh.out
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+Just a string: &lt;b&gt;Test&lt;/b&gt;
+Captured output: <b>Test</b>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert.ftlh
new file mode 100644
index 0000000..e0d3348
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert.ftlh
@@ -0,0 +1,27 @@
+<#--
+  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.
+-->
+<#assign mo1 = "Foo's bar {}"?esc>
+HTLM: ${mo1}
+XML:  <#outputformat 'XML'>${mo1}</#outputformat>
+RTF:  <#outputformat 'RTF'>${mo1}</#outputformat>
+
+<#assign mo2><p>Test</#assign>
+HTML: ${mo2}
+XML:  <#attempt><#outputformat 'XML'>${mo2}</#outputformat><#recover>Failed</#attempt>
+RTF:  <#attempt><#outputformat 'RTF'>${mo2}</#outputformat><#recover>Failed</#attempt>

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert.ftlh.out
new file mode 100644
index 0000000..65be2a0
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert.ftlh.out
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+HTLM: Foo&#39;s bar {}
+XML:  Foo&apos;s bar {}
+RTF:  Foo's bar \{\}
+
+HTML: <p>Test
+XML:  Failed
+RTF:  Failed

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert2.ftl
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert2.ftl b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert2.ftl
new file mode 100644
index 0000000..80ae292
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert2.ftl
@@ -0,0 +1,25 @@
+<#--
+  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.
+-->
+<#outputformat "HTML"><#assign htmlMO><p>Test</#assign></#outputformat>
+<#outputformat "XML"><#assign xmlMO><p>Test</p></#assign></#outputformat>
+<#outputformat "RTF"><#assign rtfMO>\par Test</#assign></#outputformat>
+<#-- We assume that we have "undefined" output format here. -->
+HTML: ${htmlMO}
+XML:  ${xmlMO}
+RTF:  ${rtfMO}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert2.ftl.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert2.ftl.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert2.ftl.out
new file mode 100644
index 0000000..cd84bd2
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-convert2.ftl.out
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+HTML: <p>Test
+XML:  <p>Test</p>
+RTF:  \par Test
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-infoBox.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-infoBox.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-infoBox.ftlh
new file mode 100644
index 0000000..9b8dbd9
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-infoBox.ftlh
@@ -0,0 +1,26 @@
+<#--
+  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.
+-->
+<@infoBox "Foo & bar" />
+<@infoBox "Foo <b>bar</b>"?no_esc />
+
+<#macro infoBox message>
+  <div class="infoBox">
+    ${message}
+  </div>
+</#macro>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-infoBox.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-infoBox.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-infoBox.ftlh.out
new file mode 100644
index 0000000..9471ab7
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-infoBox.ftlh.out
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+  <div class="infoBox">
+    Foo &amp; bar
+  </div>
+  <div class="infoBox">
+    Foo <b>bar</b>
+  </div>
+

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-markup.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-markup.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-markup.ftlh
new file mode 100644
index 0000000..f9deeae
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-markup.ftlh
@@ -0,0 +1,28 @@
+<#--
+  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.
+-->
+<#assign markupOutput1="<b>Test</b>"?no_esc>
+<#assign markupOutput2="Foo & bar"?esc>
+
+As expected:
+${markupOutput1}
+${markupOutput2}
+
+Double escaping:
+${markupOutput1?markup_string}
+${markupOutput2?markup_string}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-markup.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-markup.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-markup.ftlh.out
new file mode 100644
index 0000000..0420cca
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-markup.ftlh.out
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+As expected:
+<b>Test</b>
+Foo &amp; bar
+
+Double escaping:
+&lt;b&gt;Test&lt;/b&gt;
+Foo &amp;amp; bar
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringConcat.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringConcat.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringConcat.ftlh
new file mode 100644
index 0000000..f7884bb
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringConcat.ftlh
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+${"<h1>"?no_esc + "Foo & bar" + "</h1>"?no_esc}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringConcat.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringConcat.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringConcat.ftlh.out
new file mode 100644
index 0000000..d016072
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringConcat.ftlh.out
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+<h1>Foo &amp; bar</h1>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral.ftlh
new file mode 100644
index 0000000..4904f60
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral.ftlh
@@ -0,0 +1,21 @@
+<#--
+  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.
+-->
+<#assign s = "Foo & bar">
+${s}
+${"${s} & baz"}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral.ftlh.out
new file mode 100644
index 0000000..c6bd10d
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral.ftlh.out
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+Foo &amp; bar
+Foo &amp; bar &amp; baz
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral2.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral2.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral2.ftlh
new file mode 100644
index 0000000..52db70b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral2.ftlh
@@ -0,0 +1,25 @@
+<#--
+  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.
+-->
+<#-- Markup output value created by escaping plain text: -->
+<#assign mo1 = "Foo & bar"?esc>
+<#-- Markup output value created outherwise: -->
+<#assign mo2 = "<p>Foo"?no_esc>
+
+${"${mo1} baz"}
+${"${mo2} baz"}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral2.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral2.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral2.ftlh.out
new file mode 100644
index 0000000..f47e521
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/AutoEscapingExample-stringLiteral2.ftlh.out
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+Foo &amp; bar baz
+<p>Foo baz
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/ConfigureOutputFormatExamples1.properties
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/ConfigureOutputFormatExamples1.properties b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/ConfigureOutputFormatExamples1.properties
new file mode 100644
index 0000000..0df9e33
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/ConfigureOutputFormatExamples1.properties
@@ -0,0 +1,21 @@
+# 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.
+
+templateConfigurations = \
+    ConditionalTemplateConfigurationFactory( \
+        PathGlobMatcher("mail/**"), \
+        TemplateConfiguration(outputFormat = HTMLOutputFormat()))
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/ConfigureOutputFormatExamples2.properties
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/ConfigureOutputFormatExamples2.properties b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/ConfigureOutputFormatExamples2.properties
new file mode 100644
index 0000000..5d2a738
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/ConfigureOutputFormatExamples2.properties
@@ -0,0 +1,31 @@
+# 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.
+
+templateConfigurations = \
+    FirstMatchTemplateConfigurationFactory( \
+        ConditionalTemplateConfigurationFactory( \
+            FileExtensionMatcher("xml"), \
+            TemplateConfiguration(outputFormat = XMLOutputFormat())), \
+        ConditionalTemplateConfigurationFactory( \
+            OrMatcher( \
+                FileExtensionMatcher("html"), \
+                FileExtensionMatcher("htm")), \
+            TemplateConfiguration(outputFormat = HTMLOutputFormat())), \
+        ConditionalTemplateConfigurationFactory( \
+            FileExtensionMatcher("rtf"), \
+            TemplateConfiguration(outputFormat = RTFOutputFormat())), \
+        allowNoMatch = true)

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias1.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias1.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias1.ftlh
new file mode 100644
index 0000000..fe9690c
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias1.ftlh
@@ -0,0 +1,22 @@
+<#--
+  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.
+-->
+${p?string.@price}
+${w?string.@weight}
+${fd?string.@fileDate}
+${let?datetime?string.@logEventTime}

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias1.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias1.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias1.ftlh.out
new file mode 100644
index 0000000..717431f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias1.ftlh.out
@@ -0,0 +1,22 @@
+/*
+ * 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.
+ */
+10,000.00
+10.31
+23/Dec/15 10:09 PM
+2015-12-23T21:09:04.213Z

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias2.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias2.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias2.ftlh
new file mode 100644
index 0000000..624950f
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias2.ftlh
@@ -0,0 +1,19 @@
+<#--
+  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.
+-->
+${10?string.@oct}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias2.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias2.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias2.ftlh.out
new file mode 100644
index 0000000..08d0fea
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-alias2.ftlh.out
@@ -0,0 +1,19 @@
+/*
+ * 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.
+ */
+12
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-modelAware.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-modelAware.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-modelAware.ftlh
new file mode 100644
index 0000000..9a34ac0
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-modelAware.ftlh
@@ -0,0 +1,20 @@
+<#--
+  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.
+-->
+${10.12356}
+${weight}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-modelAware.ftlh.out
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-modelAware.ftlh.out b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-modelAware.ftlh.out
new file mode 100644
index 0000000..25d6155
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/CustomFormatsExample-modelAware.ftlh.out
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+10.1236
+1.5 kg
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples1.properties
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples1.properties b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples1.properties
new file mode 100644
index 0000000..faf8592
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples1.properties
@@ -0,0 +1,25 @@
+# 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.
+
+templateConfigurations = \
+    ConditionalTemplateConfigurationFactory( \
+        FileExtensionMatcher("xml"), \
+        TemplateConfiguration( \
+            sourceEncoding = Charset("utf-8"), \
+            outputFormat = XMLOutputFormat() \
+        ) \
+    )
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples2.properties
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples2.properties b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples2.properties
new file mode 100644
index 0000000..f879e70
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples2.properties
@@ -0,0 +1,32 @@
+# 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.
+
+templateConfigurations = \
+    ConditionalTemplateConfigurationFactory( \
+        PathGlobMatcher("mail/**"), \
+        FirstMatchTemplateConfigurationFactory( \
+            ConditionalTemplateConfigurationFactory( \
+                FileNameGlobMatcher("*.subject.*"), \
+                TemplateConfiguration(outputFormat = PlainTextOutputFormat()) \
+            ), \
+            ConditionalTemplateConfigurationFactory( \
+                FileNameGlobMatcher("*.body.*"), \
+                TemplateConfiguration(outputFormat = HTMLOutputFormat()) \
+            ), \
+            noMatchErrorDetails = 'Mail template names must contain ".subject." or ".body."!' \
+        ) \
+    )

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples3.properties
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples3.properties b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples3.properties
new file mode 100644
index 0000000..ce72fef
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/TemplateConfigurationExamples3.properties
@@ -0,0 +1,47 @@
+# 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.
+
+templateConfigurations = \
+    MergingTemplateConfigurationFactory( \
+        ConditionalTemplateConfigurationFactory( \
+            FileNameGlobMatcher("*.stats.*"), \
+            TemplateConfiguration( \
+                dateTimeFormat = "iso", \
+                dateFormat = "iso", \
+                timeFormat = "iso", \
+                timeZone = TimeZone("UTC") \
+            ) \
+        ), \
+        ConditionalTemplateConfigurationFactory( \
+            PathGlobMatcher("mail/**"), \
+            TemplateConfiguration(sourceEncoding = Charset("utf-8")) \
+        ), \
+        FirstMatchTemplateConfigurationFactory( \
+            ConditionalTemplateConfigurationFactory( \
+                FileExtensionMatcher("xml"), \
+                TemplateConfiguration(outputFormat = XMLOutputFormat()) \
+            ), \
+            ConditionalTemplateConfigurationFactory( \
+                OrMatcher( \
+                    FileExtensionMatcher("html"), \
+                    FileExtensionMatcher("htm") \
+                ), \
+                TemplateConfiguration(outputFormat = HTMLOutputFormat()) \
+            ), \
+            allowNoMatch = true \
+        ) \
+    )

http://git-wip-us.apache.org/repos/asf/incubator-freemarker/blob/28a276c8/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/test.ftlh
----------------------------------------------------------------------
diff --git a/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/test.ftlh b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/test.ftlh
new file mode 100644
index 0000000..852b82b
--- /dev/null
+++ b/freemarker-core-test/src/test/resources/org/apache/freemarker/manualtest/test.ftlh
@@ -0,0 +1,28 @@
+<#--
+  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.
+-->
+<html>
+<head>
+  <title>Welcome!</title>
+</head>
+<body>
+  <h1>Welcome ${user}!</h1>
+  <p>Our latest product:
+  <a href="${latestProduct.url}">${latestProduct.name}</a>!
+</body>
+</html>
\ No newline at end of file


Mime
View raw message