| # ========================================================= |
| # |
| # (c) 2004, RenderX |
| # |
| # Author: Alexander Peshkov <peshkov@renderx.com> |
| # |
| # Permission is granted to use this document, copy and |
| # modify free of charge, provided that every derived work |
| # bear a reference to the present document. |
| # |
| # This document contains a computer program written in |
| # XSL Transformations Language. It is published with no |
| # warranty of any kind about its usability, as a mere |
| # example of XSL technology. RenderX shall not be |
| # considered liable for any damage or loss of data caused |
| # by use of this program. |
| # |
| # ========================================================= |
| |
| namespace local = "" |
| default namespace fo = "http://www.w3.org/1999/XSL/Format" |
| namespace rx = "http://www.renderx.com/XSL/Extensions" |
| |
| # *************************************************************** |
| # Common XSL FO datatypes definitions |
| # *************************************************************** |
| integer.datatype = xsd:integer |
| number.datatype = xsd:decimal |
| length.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em)" } |
| angle.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(deg|grad|rad)" } |
| percentage.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)%" } |
| character.datatype = xsd:string { pattern = ".|\r|\n" } |
| string.datatype = string |
| name.datatype = xsd:NCName |
| family-name.datatype = xsd:normalizedString |
| #MEMO: Should I add some constraints to the family-name.datatype? |
| color.datatype= xsd:token |
| #MEMO: Should I add some constraints to the color.datatype? |
| country.datatype = xsd:string { pattern = "\w{2,3}" } |
| language.datatype = xsd:string { pattern = "\w{2,3}" } |
| script.datatype = xsd:string { pattern = "\w" } |
| #MEMO: Should I add detailed constraints to the country/language/script.datatype? |
| uri-specification.datatype = xsd:string |
| #MEMO: Should I add some constraints to the uri-specification.datatype? |
| time.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(m?s)" } |
| frequency.datatype = xsd:string { pattern = "[\-+]?(\d*\.?\d+)(k?Hz)" } |
| # NOTE: <shape> datatype added in XSL FO 1.0 Errata |
| shape.datatype = xsd:normalizedString { pattern = "(([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto) (([\-+]?(\d*\.?\d+)(cm|mm|in|pt|pc|px|em))|auto)" } |
| |
| # *************************************************************** |
| # Special datatype - expressions |
| # *************************************************************** |
| #MEMO: simple example of constraint for functions |
| expr.datatype = xsd:normalizedString { pattern = ".*\(.*\).*" } |
| |
| x = abc:x { |
| |
| } |