From 66cfb865fbfa7af514e803003f928d77f1156e46 Mon Sep 17 00:00:00 2001 From: mcentner Date: Thu, 11 Sep 2008 12:16:35 +0000 Subject: Added to be signed data validation. git-svn-id: https://joinup.ec.europa.eu/svn/mocca/trunk@32 8a26b1a7-26f0-462f-b9ef-d0e30c41f5a4 --- .../at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java | 251 ++++++++ .../egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java | 95 +++ .../bku/slxhtml/css/CssBackgroundColorSLXHTML.java | 57 ++ .../egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java | 93 +++ .../slxhtml/css/CssBorderBottomColorSLXHTML.java | 57 ++ .../bku/slxhtml/css/CssBorderColorSLXHTML.java | 81 +++ .../bku/slxhtml/css/CssBorderLeftColorSLXHTML.java | 57 ++ .../slxhtml/css/CssBorderRightColorSLXHTML.java | 57 ++ .../gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java | 85 +++ .../bku/slxhtml/css/CssBorderTopColorSLXHTML.java | 57 ++ .../gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java | 99 ++++ .../at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java | 59 ++ .../bku/slxhtml/css/CssLetterSpacingSLXHTML.java | 54 ++ .../bku/slxhtml/css/CssMarginBottomSLXHTML.java | 60 ++ .../egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java | 61 ++ .../bku/slxhtml/css/CssMarginRightSLXHTML.java | 60 ++ .../gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java | 101 ++++ .../egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java | 61 ++ .../bku/slxhtml/css/CssPaddingBottomSLXHTML.java | 60 ++ .../bku/slxhtml/css/CssPaddingLeftSLXHTML.java | 60 ++ .../bku/slxhtml/css/CssPaddingRightSLXHTML.java | 60 ++ .../gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java | 102 ++++ .../egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java | 61 ++ .../bku/slxhtml/css/CssTextDecorationSLXHTML.java | 51 ++ .../bku/slxhtml/css/CssWordSpacingSLXHTML.java | 54 ++ .../slxhtml/css/SLXHTMLInvalidParamException.java | 71 +++ .../at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java | 22 + .../egiz/bku/slxhtml/css/TableLayoutSLXHTML.java | 45 ++ .../java/at/gv/egiz/bku/text/TextValidator.java | 32 + .../services/at.gv.egiz.bku.viewer.Validator | 2 + .../at/gv/egiz/bku/slxhtml/slxhtml-model-1.xsd | 469 +++++++++++++++ .../at/gv/egiz/bku/slxhtml/slxhtml-modules-1.xsd | 248 ++++++++ .../resources/at/gv/egiz/bku/slxhtml/slxhtml.xsd | 70 +++ .../at/gv/egiz/bku/slxhtml/xhtml-attribs-1.xsd | 72 +++ .../at/gv/egiz/bku/slxhtml/xhtml-blkphras-1.xsd | 161 ++++++ .../at/gv/egiz/bku/slxhtml/xhtml-blkpres-1.xsd | 37 ++ .../at/gv/egiz/bku/slxhtml/xhtml-blkstruct-1.xsd | 49 ++ .../at/gv/egiz/bku/slxhtml/xhtml-datatypes-1.xsd | 175 ++++++ .../at/gv/egiz/bku/slxhtml/xhtml-framework-1.xsd | 66 +++ .../at/gv/egiz/bku/slxhtml/xhtml-image-1.xsd | 45 ++ .../at/gv/egiz/bku/slxhtml/xhtml-inlphras-1.xsd | 163 ++++++ .../at/gv/egiz/bku/slxhtml/xhtml-inlpres-1.xsd | 39 ++ .../at/gv/egiz/bku/slxhtml/xhtml-inlstruct-1.xsd | 50 ++ .../at/gv/egiz/bku/slxhtml/xhtml-list-1.xsd | 99 ++++ .../at/gv/egiz/bku/slxhtml/xhtml-pres-1.xsd | 51 ++ .../at/gv/egiz/bku/slxhtml/xhtml-struct-1.xsd | 116 ++++ .../at/gv/egiz/bku/slxhtml/xhtml-style-1.xsd | 53 ++ .../at/gv/egiz/bku/slxhtml/xhtml-table-1.xsd | 272 +++++++++ .../at/gv/egiz/bku/slxhtml/xhtml-text-1.xsd | 67 +++ .../main/resources/at/gv/egiz/bku/slxhtml/xml.xsd | 145 +++++ .../org/w3c/css/properties/Config.properties | 32 + .../css/properties/ProfilesProperties.properties | 30 + .../css/properties/SLXHTMLProperties.properties | 641 +++++++++++++++++++++ .../java/at/gv/egiz/bku/slxhtml/ValidatorTest.java | 66 +++ .../gv/egiz/bku/slxhtml/css/CssValidatorTest.java | 75 +++ .../resources/at/gv/egiz/bku/slxhtml/test.xhtml | 10 + .../src/test/resources/commons-logging.properties | 1 + BKUViewer/src/test/resources/log4j.properties | 19 + 58 files changed, 5386 insertions(+) create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundColorSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderBottomColorSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderColorSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderLeftColorSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderRightColorSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderTopColorSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssLetterSpacingSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginBottomSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginRightSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingBottomSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingLeftSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingRightSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssTextDecorationSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssWordSpacingSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLInvalidParamException.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/TableLayoutSLXHTML.java create mode 100644 BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java create mode 100644 BKUViewer/src/main/resources/META-INF/services/at.gv.egiz.bku.viewer.Validator create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml-model-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml-modules-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-attribs-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkphras-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkpres-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkstruct-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-datatypes-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-framework-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-image-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlphras-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlpres-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlstruct-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-list-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-pres-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-struct-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-style-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-table-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-text-1.xsd create mode 100644 BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xml.xsd create mode 100644 BKUViewer/src/main/resources/org/w3c/css/properties/Config.properties create mode 100644 BKUViewer/src/main/resources/org/w3c/css/properties/ProfilesProperties.properties create mode 100644 BKUViewer/src/main/resources/org/w3c/css/properties/SLXHTMLProperties.properties create mode 100644 BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/ValidatorTest.java create mode 100644 BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/css/CssValidatorTest.java create mode 100644 BKUViewer/src/test/resources/at/gv/egiz/bku/slxhtml/test.xhtml create mode 100644 BKUViewer/src/test/resources/commons-logging.properties create mode 100644 BKUViewer/src/test/resources/log4j.properties (limited to 'BKUViewer/src') diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java new file mode 100644 index 00000000..7ce5fdbe --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/SLXHTMLValidator.java @@ -0,0 +1,251 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.net.URL; +import java.nio.charset.Charset; +import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.UnsupportedCharsetException; +import java.util.Locale; + +import javax.xml.XMLConstants; +import javax.xml.parsers.ParserConfigurationException; +import javax.xml.parsers.SAXParser; +import javax.xml.parsers.SAXParserFactory; +import javax.xml.validation.Schema; +import javax.xml.validation.SchemaFactory; +import javax.xml.validation.ValidatorHandler; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.helpers.DefaultHandler; + +import at.gv.egiz.bku.slxhtml.css.CSSValidatorSLXHTML; +import at.gv.egiz.bku.viewer.ValidationException; + +public class SLXHTMLValidator implements at.gv.egiz.bku.viewer.Validator { + + /** + * The schema file for the SLXHTML schema. + */ + private static final String SLXHTML_SCHEMA_FILE = "at/gv/egiz/bku/slxhtml/slxhtml.xsd"; + + /** + * Logging facility. + */ + private static Log log = LogFactory.getLog(SLXHTMLValidator.class); + + private static Schema slSchema; + + /** + * Initialize the security layer schema. + */ + private synchronized static void ensureSchema() { + if (slSchema == null) { + try { + SchemaFactory schemaFactory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI); + ClassLoader cl = SLXHTMLValidator.class.getClassLoader(); + URL schemaURL = cl.getResource(SLXHTML_SCHEMA_FILE); + log.debug("Trying to create SLXHTML schema from URL '" + schemaURL + "'."); + long t0 = System.currentTimeMillis(); + slSchema = schemaFactory.newSchema(schemaURL); + long t1 = System.currentTimeMillis(); + log.debug("SLXHTML schema successfully created in " + (t1 - t0) + "ms."); + } catch (SAXException e) { + log.error("Failed to load security layer XHTML schema.", e); + throw new RuntimeException("Failed to load security layer XHTML schema.", e); + } + + } + } + + public SLXHTMLValidator() { + ensureSchema(); + } + + public void validate(InputStream is, String charset) + throws ValidationException { + if (charset == null) { + validate(is, (Charset) null); + } else { + try { + validate(is, Charset.forName(charset)); + } catch (IllegalCharsetNameException e) { + throw new ValidationException(e); + } catch (UnsupportedCharsetException e) { + throw new ValidationException(e); + } + } + } + + public void validate(InputStream is, Charset charset) throws ValidationException { + + SAXParserFactory spf = SAXParserFactory.newInstance(); + spf.setNamespaceAware(true); + spf.setSchema(slSchema); + spf.setValidating(true); + spf.setXIncludeAware(false); + + SAXParser parser; + try { + parser = spf.newSAXParser(); + } catch (ParserConfigurationException e) { + log.error("Failed to create SLXHTML parser.", e); + throw new RuntimeException("Failed to create SLXHTML parser.", e); + } catch (SAXException e) { + log.error("Failed to create SLXHTML parser.", e); + throw new RuntimeException("Failed to create SLXHTML parser.", e); + } + + InputSource source; + if (charset != null) { + source = new InputSource(new InputStreamReader(is, charset)); + } else { + source = new InputSource(is); + } + + + ValidatorHandler validatorHandler = slSchema.newValidatorHandler(); + + DefaultHandler defaultHandler = new ValidationHandler(validatorHandler); + try { + parser.parse(source, defaultHandler); + } catch (SAXException e) { + if (e.getException() instanceof ValidationException) { + throw (ValidationException) e.getException(); + } else { + throw new ValidationException(e); + } + } catch (IOException e) { + throw new ValidationException(e); + } + + } + + private void validateCss(InputStream is) throws ValidationException { + CSSValidatorSLXHTML cssValidator = new CSSValidatorSLXHTML(); + // TODO: use the right locale + cssValidator.validate(is, Locale.getDefault(), "SLXHTML", 0); + } + + private class ValidationHandler extends DefaultHandler implements ContentHandler { + + private ValidatorHandler validatorHandler; + + private boolean insideStyle = false; + + private StringBuffer style = new StringBuffer(); + + private ValidationHandler(ValidatorHandler contentHandler) { + this.validatorHandler = contentHandler; + } + + @Override + public void endDocument() throws SAXException { + validatorHandler.endDocument(); + } + + @Override + public void endPrefixMapping(String prefix) throws SAXException { + validatorHandler.endPrefixMapping(prefix); + } + + @Override + public void ignorableWhitespace(char[] ch, int start, int length) + throws SAXException { + validatorHandler.ignorableWhitespace(ch, start, length); + } + + @Override + public void processingInstruction(String target, String data) + throws SAXException { + validatorHandler.processingInstruction(target, data); + } + + @Override + public void setDocumentLocator(Locator locator) { + validatorHandler.setDocumentLocator(locator); + } + + @Override + public void skippedEntity(String name) throws SAXException { + validatorHandler.skippedEntity(name); + } + + @Override + public void startDocument() throws SAXException { + validatorHandler.startDocument(); + } + + @Override + public void startPrefixMapping(String prefix, String uri) + throws SAXException { + validatorHandler.startPrefixMapping(prefix, uri); + } + + @Override + public void startElement(String uri, String localName, String name, + Attributes attributes) throws SAXException { + validatorHandler.startElement(uri, localName, name, attributes); + + System.out.println(uri + ":" + localName); + + if ("http://www.w3.org/1999/xhtml".equals(uri) && + "style".equals(localName)) { + insideStyle = true; + } + } + + @Override + public void characters(char[] ch, int start, int length) + throws SAXException { + validatorHandler.characters(ch, start, length); + + if (insideStyle) { + style.append(ch, start, length); + } + + } + + @Override + public void endElement(String uri, String localName, String name) + throws SAXException { + validatorHandler.endElement(uri, localName, name); + + if (insideStyle) { + insideStyle = false; + try { + validateCss(new ByteArrayInputStream(style.toString().getBytes(Charset.forName("UTF-8")))); + } catch (ValidationException e) { + throw new SAXException(e); + } + } + } + + } + + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java new file mode 100644 index 00000000..7abe4741 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CSSValidatorSLXHTML.java @@ -0,0 +1,95 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.Locale; + +import org.w3c.css.css.CssParser; +import org.w3c.css.css.StyleSheet; +import org.w3c.css.css.StyleSheetParser; +import org.w3c.css.parser.CssError; +import org.w3c.css.parser.Errors; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.Util; +import org.w3c.css.util.Warning; +import org.w3c.css.util.Warnings; + +import at.gv.egiz.bku.viewer.ValidationException; + +public class CSSValidatorSLXHTML { + + public void validate(InputStream input, Locale locale, String title, int lineno) throws ValidationException { + + // disable imports + Util.importSecurity = true; + + CssParser cssParser = new StyleSheetParser(); + + ApplContext ac = new ApplContext(locale.getLanguage()); + ac.setCssVersion("slxhtml"); + ac.setMedium("all"); + + URL url; + try { + url = new URL("http://test.xyz"); + } catch (MalformedURLException e) { + throw new RuntimeException(e); + } + + cssParser.parseStyleElement(ac, input, title, "all", url, lineno); + + StyleSheet styleSheet = cssParser.getStyleSheet(); + + // find conflicts + styleSheet.findConflicts(ac); + + boolean valid = true; + StringBuilder sb = new StringBuilder().append("CSS:"); + + // look for errors + Errors errors = styleSheet.getErrors(); + if (errors.getErrorCount() != 0) { + valid = false; + CssError[] cssErrors = errors.getErrors(); + for (CssError cssError : cssErrors) { + Exception exception = cssError.getException(); + sb.append(" "); + sb.append(exception.getMessage()); + } + } + + // look for warnings + Warnings warnings = styleSheet.getWarnings(); + if (warnings.getWarningCount() != 0) { + valid = false; + Warning[] cssWarnings = warnings.getWarnings(); + for (Warning warning : cssWarnings) { + sb.append(" "); + sb.append(warning.getWarningMessage()); + } + } + + if (!valid) { + throw new ValidationException(sb.toString()); + } + + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundColorSLXHTML.java new file mode 100644 index 00000000..53191d17 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundColorSLXHTML.java @@ -0,0 +1,57 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssBackgroundColorCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +public class CssBackgroundColorSLXHTML extends CssBackgroundColorCSS2 { + + public CssBackgroundColorSLXHTML() { + } + + public CssBackgroundColorSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + CssValue color = getColor(); + if (!isSoftlyInherited() && color != null) { + if (CssColorSLXHTML.isDisallowedColor(color)) { + throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac); + } + } + + } + + public CssBackgroundColorSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + super(ac, expression); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java new file mode 100644 index 00000000..724c8c6a --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBackgroundSLXHTML.java @@ -0,0 +1,93 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +/** + * + */ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssBackgroundCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +/** + * @author mcentner + * + */ +public class CssBackgroundSLXHTML extends CssBackgroundCSS2 { + + public CssBackgroundSLXHTML() { + } + + public CssBackgroundSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + CssValue color = getColor(); + if (!isSoftlyInherited() && color != null) { + if (CssColorSLXHTML.isDisallowedColor(color)) { + throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac); + } + } + + // The properties for selecting and controlling an image as background + // (background-image, background-repeat, background-position, + // background-attachment; cf. [CSS 2], section 14.2.1) must not be contained + // in an instance document to prevent content from overlapping. Otherwise + // the instance document must be rejected by the Citizen Card Environment. + // + // The property for the shorthand version of the background properties + // (background) should be supported by a Citizen Card Environment. The + // recommended values result from the explanations for the background-color + // property above (cf. [CSS 2], section 14.2.1). If the property contains + // values for selecting and controlling an image as background, the instance + // document must be rejected by the Citizen Card Environment. + + if (getImage() != null) { + throw new SLXHTMLInvalidParamException("background", "background-image", ac); + } + + if (getRepeat() != null) { + throw new SLXHTMLInvalidParamException("background", "background-repeat", ac); + } + + if (getPosition() != null) { + throw new SLXHTMLInvalidParamException("background", "background-position", ac); + } + + if (getAttachment() != null) { + throw new SLXHTMLInvalidParamException("background", "background-attachment", ac); + } + + } + + public CssBackgroundSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderBottomColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderBottomColorSLXHTML.java new file mode 100644 index 00000000..4f5798b0 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderBottomColorSLXHTML.java @@ -0,0 +1,57 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssBorderBottomColorCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +public class CssBorderBottomColorSLXHTML extends CssBorderBottomColorCSS2 { + + public CssBorderBottomColorSLXHTML() { + } + + public CssBorderBottomColorSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + CssValue color = getColor(); + if (!isSoftlyInherited() && color != null) { + if (CssColorSLXHTML.isDisallowedColor(color)) { + throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac); + } + } + + } + + public CssBorderBottomColorSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderColorSLXHTML.java new file mode 100644 index 00000000..3f5a7319 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderColorSLXHTML.java @@ -0,0 +1,81 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssBorderBottomColorCSS2; +import org.w3c.css.properties.css1.CssBorderColorCSS2; +import org.w3c.css.properties.css1.CssBorderLeftColorCSS2; +import org.w3c.css.properties.css1.CssBorderRightColorCSS2; +import org.w3c.css.properties.css1.CssBorderTopColorCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssBorderColorSLXHTML extends CssBorderColorCSS2 { + + public CssBorderColorSLXHTML() { + } + + public CssBorderColorSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + CssBorderTopColorCSS2 top = getTop(); + if (!isSoftlyInherited() && top != null) { + if (CssColorSLXHTML.isDisallowedColor(top.getColor())) { + throw new SLXHTMLInvalidParamException("color", top.getColor(), getPropertyName(), ac); + } + } + + CssBorderLeftColorCSS2 left = getLeft(); + if (!isSoftlyInherited() && left != null) { + if (CssColorSLXHTML.isDisallowedColor(left.getColor())) { + throw new SLXHTMLInvalidParamException("color", left.getColor(), getPropertyName(), ac); + } + } + + CssBorderRightColorCSS2 right = getRight(); + if (!isSoftlyInherited() && right != null) { + if (CssColorSLXHTML.isDisallowedColor(right.getColor())) { + throw new SLXHTMLInvalidParamException("color", right.getColor(), getPropertyName(), ac); + } + } + + CssBorderBottomColorCSS2 bottom = getBottom(); + if (!isSoftlyInherited() && bottom != null) { + if (CssColorSLXHTML.isDisallowedColor(bottom.getColor())) { + throw new SLXHTMLInvalidParamException("color", bottom.getColor(), getPropertyName(), ac); + } + } + + } + + public CssBorderColorSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderLeftColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderLeftColorSLXHTML.java new file mode 100644 index 00000000..e2378e99 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderLeftColorSLXHTML.java @@ -0,0 +1,57 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssBorderLeftColorCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +public class CssBorderLeftColorSLXHTML extends CssBorderLeftColorCSS2 { + + public CssBorderLeftColorSLXHTML() { + } + + public CssBorderLeftColorSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + CssValue color = getColor(); + if (!isSoftlyInherited() && color != null) { + if (CssColorSLXHTML.isDisallowedColor(color)) { + throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac); + } + } + + } + + public CssBorderLeftColorSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderRightColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderRightColorSLXHTML.java new file mode 100644 index 00000000..99d6bae5 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderRightColorSLXHTML.java @@ -0,0 +1,57 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssBorderRightColorCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +public class CssBorderRightColorSLXHTML extends CssBorderRightColorCSS2 { + + public CssBorderRightColorSLXHTML() { + } + + public CssBorderRightColorSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + CssValue color = getColor(); + if (!isSoftlyInherited() && color != null) { + if (CssColorSLXHTML.isDisallowedColor(color)) { + throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac); + } + } + + } + + public CssBorderRightColorSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java new file mode 100644 index 00000000..ac32670e --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderSLXHTML.java @@ -0,0 +1,85 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssBorderCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +public class CssBorderSLXHTML extends CssBorderCSS2 { + + public CssBorderSLXHTML() { + } + + public CssBorderSLXHTML(ApplContext ac, CssExpression value, boolean check) + throws InvalidParamException { + super(ac, value, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + if (getTop() != null) { + CssValue top = getTop().getColor(); + if (!isSoftlyInherited() && top != null) { + if (CssColorSLXHTML.isDisallowedColor(top)) { + throw new SLXHTMLInvalidParamException("color", top, getPropertyName(), ac); + } + } + } + + if (getLeft() != null) { + CssValue left = getLeft().getColor(); + if (!isSoftlyInherited() && left != null) { + if (CssColorSLXHTML.isDisallowedColor(left)) { + throw new SLXHTMLInvalidParamException("color", left, getPropertyName(), ac); + } + } + } + + if (getRight() != null) { + CssValue right = getRight().getColor(); + if (!isSoftlyInherited() && right != null) { + if (CssColorSLXHTML.isDisallowedColor(right)) { + throw new SLXHTMLInvalidParamException("color", right, getPropertyName(), ac); + } + } + } + + if (getBottom() != null) { + CssValue bottom = getBottom().getColor(); + if (!isSoftlyInherited() && bottom != null) { + if (CssColorSLXHTML.isDisallowedColor(bottom)) { + throw new SLXHTMLInvalidParamException("color", bottom, getPropertyName(), ac); + } + } + } + } + + public CssBorderSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderTopColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderTopColorSLXHTML.java new file mode 100644 index 00000000..42926479 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssBorderTopColorSLXHTML.java @@ -0,0 +1,57 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssBorderTopColorCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +public class CssBorderTopColorSLXHTML extends CssBorderTopColorCSS2 { + + public CssBorderTopColorSLXHTML() { + } + + public CssBorderTopColorSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + CssValue color = getColor(); + if (!isSoftlyInherited() && color != null) { + if (CssColorSLXHTML.isDisallowedColor(color)) { + throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac); + } + } + + } + + public CssBorderTopColorSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java new file mode 100644 index 00000000..a640eb3a --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssColorSLXHTML.java @@ -0,0 +1,99 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import java.util.HashSet; +import java.util.Set; + +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +public class CssColorSLXHTML extends org.w3c.css.properties.css1.CssColorCSS2 { + + private static Set SLXHTML_DISSALLOWED_COLORS = new HashSet(); + + static { + + SLXHTML_DISSALLOWED_COLORS.add("activeborder"); + SLXHTML_DISSALLOWED_COLORS.add("activecaption"); + SLXHTML_DISSALLOWED_COLORS.add("appworkspace"); + SLXHTML_DISSALLOWED_COLORS.add("background"); + SLXHTML_DISSALLOWED_COLORS.add("buttonface"); + SLXHTML_DISSALLOWED_COLORS.add("buttonhighlight"); + SLXHTML_DISSALLOWED_COLORS.add("buttonshadow"); + SLXHTML_DISSALLOWED_COLORS.add("buttontext"); + SLXHTML_DISSALLOWED_COLORS.add("captiontext"); + SLXHTML_DISSALLOWED_COLORS.add("graytext"); + SLXHTML_DISSALLOWED_COLORS.add("highlight"); + SLXHTML_DISSALLOWED_COLORS.add("highlighttext"); + SLXHTML_DISSALLOWED_COLORS.add("inactiveborder"); + SLXHTML_DISSALLOWED_COLORS.add("inactivecaption"); + SLXHTML_DISSALLOWED_COLORS.add("inactivecaptiontext"); + SLXHTML_DISSALLOWED_COLORS.add("infobackground"); + SLXHTML_DISSALLOWED_COLORS.add("infotext"); + SLXHTML_DISSALLOWED_COLORS.add("menu"); + SLXHTML_DISSALLOWED_COLORS.add("menutext"); + SLXHTML_DISSALLOWED_COLORS.add("scrollbar"); + SLXHTML_DISSALLOWED_COLORS.add("threeddarkshadow"); + SLXHTML_DISSALLOWED_COLORS.add("threedface"); + SLXHTML_DISSALLOWED_COLORS.add("threedhighlight"); + SLXHTML_DISSALLOWED_COLORS.add("threedlightshadow"); + SLXHTML_DISSALLOWED_COLORS.add("threedshadow"); + SLXHTML_DISSALLOWED_COLORS.add("window"); + SLXHTML_DISSALLOWED_COLORS.add("windowframe"); + SLXHTML_DISSALLOWED_COLORS.add("windowtext"); + + } + + public static boolean isDisallowedColor(CssValue cssValue) { + return SLXHTML_DISSALLOWED_COLORS.contains(cssValue.toString().toLowerCase()); + } + + public CssColorSLXHTML() { + } + + public CssColorSLXHTML(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + + super(ac, expression, check); + + // A Citizen Card Environment must support all the options for specifying a + // colour listed in [CSS 2], section 4.3.6 for a CSS property, if such an + // option is available for this property according to [CSS 2]. + + // The exceptions are the system colours (cf. [CSS 2], section 18.2); these + // must not be used in an instance document so as to prevent dependencies on + // the system environment. Otherwise the instance document must be rejected + // by the Citizen Card Environment. + + CssValue color = getColor(); + if (!isSoftlyInherited() && color != null) { + if (CssColorSLXHTML.isDisallowedColor(color)) { + throw new SLXHTMLInvalidParamException("color", color, getPropertyName(), ac); + } + } + + } + + public CssColorSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java new file mode 100644 index 00000000..8e5298ec --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssFontSLXHTML.java @@ -0,0 +1,59 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssFontCSS2; +import org.w3c.css.properties.css1.CssFontConstantCSS2; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssIdent; +import org.w3c.css.values.CssValue; + +public class CssFontSLXHTML extends CssFontCSS2 { + + public CssFontSLXHTML() { + } + + public CssFontSLXHTML(ApplContext ac, CssExpression expression, boolean check) + throws InvalidParamException { + super(ac, checkExpression(expression, ac), check); + } + + public CssFontSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + protected static CssExpression checkExpression(CssExpression expression, + ApplContext ac) throws InvalidParamException { + + CssValue value = expression.getValue(); + + if (value instanceof CssIdent) { + for (String font : CssFontConstantCSS2.FONT) { + if (font.equalsIgnoreCase(value.toString())) { + throw new SLXHTMLInvalidParamException("font", value.toString(), ac); + } + } + } + + return expression; + + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssLetterSpacingSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssLetterSpacingSLXHTML.java new file mode 100644 index 00000000..326a731f --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssLetterSpacingSLXHTML.java @@ -0,0 +1,54 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssLetterSpacing; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssLength; +import org.w3c.css.values.CssNumber; + +public class CssLetterSpacingSLXHTML extends CssLetterSpacing { + + public CssLetterSpacingSLXHTML() { + } + + public CssLetterSpacingSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + Object value = get(); + if (value instanceof CssLength) { + Object length = ((CssLength) value).get(); + if (length instanceof Float && ((Float) length).floatValue() < 0) { + throw new SLXHTMLInvalidParamException("spacing", length, getPropertyName(), ac); + } + } else if (value instanceof CssNumber) { + if (((CssNumber) value).getValue() < 0) { + throw new SLXHTMLInvalidParamException("spacing", value, getPropertyName(), ac); + } + } + + } + + public CssLetterSpacingSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginBottomSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginBottomSLXHTML.java new file mode 100644 index 00000000..cac97d06 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginBottomSLXHTML.java @@ -0,0 +1,60 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssMarginBottom; +import org.w3c.css.properties.css1.CssMarginSide; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssMarginBottomSLXHTML extends CssMarginBottom { + + public CssMarginBottomSLXHTML() { + } + + public CssMarginBottomSLXHTML(CssMarginSide another) { + super(another); + } + + public CssMarginBottomSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + public CssMarginBottomSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // The margin-top, margin-bottom, margin-left and margin-right properties + // must be supported by a Citizen Card Environment. Values specified as + // percentages (cf. section 3.5.1.2) should be supported. + + // The margin property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (CssMarginSLXHTML.isDisallowedMargin(getValue())) { + throw new SLXHTMLInvalidParamException("margin", getValue(), + getPropertyName(), ac); + } + + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java new file mode 100644 index 00000000..c456af43 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginLeftSLXHTML.java @@ -0,0 +1,61 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssMarginLeft; +import org.w3c.css.properties.css1.CssMarginSide; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssMarginLeftSLXHTML extends CssMarginLeft { + + public CssMarginLeftSLXHTML() { + } + + public CssMarginLeftSLXHTML(CssMarginSide another) { + super(another); + } + + public CssMarginLeftSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + public CssMarginLeftSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // TODO Auto-generated constructor stub + // The margin-top, margin-bottom, margin-left and margin-right properties + // must be supported by a Citizen Card Environment. Values specified as + // percentages (cf. section 3.5.1.2) should be supported. + + // The margin property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (CssMarginSLXHTML.isDisallowedMargin(getValue())) { + throw new SLXHTMLInvalidParamException("margin", getValue(), + getPropertyName(), ac); + } + + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginRightSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginRightSLXHTML.java new file mode 100644 index 00000000..7f16830d --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginRightSLXHTML.java @@ -0,0 +1,60 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssMarginRight; +import org.w3c.css.properties.css1.CssMarginSide; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssMarginRightSLXHTML extends CssMarginRight { + + public CssMarginRightSLXHTML() { + } + + public CssMarginRightSLXHTML(CssMarginSide another) { + super(another); + } + + public CssMarginRightSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + public CssMarginRightSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // The margin-top, margin-bottom, margin-left and margin-right properties + // must be supported by a Citizen Card Environment. Values specified as + // percentages (cf. section 3.5.1.2) should be supported. + + // The margin property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (CssMarginSLXHTML.isDisallowedMargin(getValue())) { + throw new SLXHTMLInvalidParamException("margin", getValue(), + getPropertyName(), ac); + } + + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java new file mode 100644 index 00000000..f478b96a --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginSLXHTML.java @@ -0,0 +1,101 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssMargin; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssLength; +import org.w3c.css.values.CssNumber; +import org.w3c.css.values.CssPercentage; +import org.w3c.css.values.CssValue; + +public class CssMarginSLXHTML extends CssMargin { + + public CssMarginSLXHTML() { + } + + public CssMarginSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + if (getTop() != null) { + if (isDisallowedMargin(getTop().getValue())) { + throw new SLXHTMLInvalidParamException("margin", getTop().getValue(), + getPropertyName(), ac); + } + } + + if (getRight() != null) { + if (isDisallowedMargin(getRight().getValue())) { + throw new SLXHTMLInvalidParamException("margin", getRight().getValue(), + getPropertyName(), ac); + } + } + + if (getLeft() != null) { + if (isDisallowedMargin(getLeft().getValue())) { + throw new SLXHTMLInvalidParamException("margin", getLeft().getValue(), + getPropertyName(), ac); + } + } + + if (getBottom() != null) { + if (isDisallowedMargin(getBottom().getValue())) { + throw new SLXHTMLInvalidParamException("margin", getBottom().getValue(), + getPropertyName(), ac); + } + } + + } + + public CssMarginSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + public static boolean isDisallowedMargin(CssValue margin) { + + // The margin-top, margin-bottom, margin-left and margin-right properties + // must be supported by a Citizen Card Environment. Values specified as + // percentages (cf. section 3.5.1.2) should be supported. + + // The margin property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (margin instanceof CssLength) { + Object value = ((CssLength) margin).get(); + if (value instanceof Float) { + return ((Float) value).floatValue() < 0; + } + } else if (margin instanceof CssPercentage) { + Object value = ((CssPercentage) margin).get(); + if (value instanceof Float) { + return ((Float) value).floatValue() < 0; + } + } else if (margin instanceof CssNumber) { + return ((CssNumber) margin).getValue() < 0; + } + + return false; + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java new file mode 100644 index 00000000..06b30c4f --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssMarginTopSLXHTML.java @@ -0,0 +1,61 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssMarginSide; +import org.w3c.css.properties.css1.CssMarginTop; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssMarginTopSLXHTML extends CssMarginTop { + + public CssMarginTopSLXHTML() { + } + + public CssMarginTopSLXHTML(CssMarginSide another) { + super(another); + } + + public CssMarginTopSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + + } + + public CssMarginTopSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // The margin-top, margin-bottom, margin-left and margin-right properties + // must be supported by a Citizen Card Environment. Values specified as + // percentages (cf. section 3.5.1.2) should be supported. + + // The margin property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (CssMarginSLXHTML.isDisallowedMargin(getValue())) { + throw new SLXHTMLInvalidParamException("margin", getValue(), + getPropertyName(), ac); + } + + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingBottomSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingBottomSLXHTML.java new file mode 100644 index 00000000..4bcb0065 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingBottomSLXHTML.java @@ -0,0 +1,60 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssPaddingBottom; +import org.w3c.css.properties.css1.CssPaddingSide; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssPaddingBottomSLXHTML extends CssPaddingBottom { + + public CssPaddingBottomSLXHTML() { + } + + public CssPaddingBottomSLXHTML(CssPaddingSide another) { + super(another); + } + + public CssPaddingBottomSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // The padding-top, padding-bottom, padding-left and padding-right + // properties must be supported by a Citizen Card Environment. Values + // specified as percentages (cf. section 3.5.1.2) should be supported. + + // The padding property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (CssPaddingSLXHTML.isDisallowedValue(getValue())) { + throw new SLXHTMLInvalidParamException("padding", getValue(), + getPropertyName(), ac); + } + + } + + public CssPaddingBottomSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingLeftSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingLeftSLXHTML.java new file mode 100644 index 00000000..350a5c15 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingLeftSLXHTML.java @@ -0,0 +1,60 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssPaddingLeft; +import org.w3c.css.properties.css1.CssPaddingSide; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssPaddingLeftSLXHTML extends CssPaddingLeft { + + public CssPaddingLeftSLXHTML() { + } + + public CssPaddingLeftSLXHTML(CssPaddingSide another) { + super(another); + } + + public CssPaddingLeftSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // The padding-top, padding-bottom, padding-left and padding-right + // properties must be supported by a Citizen Card Environment. Values + // specified as percentages (cf. section 3.5.1.2) should be supported. + + // The padding property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (CssPaddingSLXHTML.isDisallowedValue(getValue())) { + throw new SLXHTMLInvalidParamException("padding", getValue(), + getPropertyName(), ac); + } + + } + + public CssPaddingLeftSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingRightSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingRightSLXHTML.java new file mode 100644 index 00000000..d2d62748 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingRightSLXHTML.java @@ -0,0 +1,60 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssPaddingRight; +import org.w3c.css.properties.css1.CssPaddingSide; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssPaddingRightSLXHTML extends CssPaddingRight { + + public CssPaddingRightSLXHTML() { + } + + public CssPaddingRightSLXHTML(CssPaddingSide another) { + super(another); + } + + public CssPaddingRightSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // The padding-top, padding-bottom, padding-left and padding-right + // properties must be supported by a Citizen Card Environment. Values + // specified as percentages (cf. section 3.5.1.2) should be supported. + + // The padding property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (CssPaddingSLXHTML.isDisallowedValue(getValue())) { + throw new SLXHTMLInvalidParamException("padding", getValue(), + getPropertyName(), ac); + } + + } + + public CssPaddingRightSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java new file mode 100644 index 00000000..57d7cf77 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingSLXHTML.java @@ -0,0 +1,102 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssPadding; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssLength; +import org.w3c.css.values.CssNumber; +import org.w3c.css.values.CssPercentage; +import org.w3c.css.values.CssValue; + +public class CssPaddingSLXHTML extends CssPadding { + + public CssPaddingSLXHTML() { + } + + public CssPaddingSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + if (getTop() != null) { + if (isDisallowedValue(getTop().getValue())) { + throw new SLXHTMLInvalidParamException("padding", getTop().getValue(), + getPropertyName(), ac); + } + } + + if (getRight() != null) { + if (isDisallowedValue(getRight().getValue())) { + throw new SLXHTMLInvalidParamException("padding", getRight().getValue(), + getPropertyName(), ac); + } + } + + if (getLeft() != null) { + if (isDisallowedValue(getLeft().getValue())) { + throw new SLXHTMLInvalidParamException("padding", getLeft().getValue(), + getPropertyName(), ac); + } + } + + if (getBottom() != null) { + if (isDisallowedValue(getBottom().getValue())) { + throw new SLXHTMLInvalidParamException("padding", getBottom().getValue(), + getPropertyName(), ac); + } + } + + } + + public CssPaddingSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + + public static boolean isDisallowedValue(CssValue padding) { + + // The padding-top, padding-bottom, padding-left and padding-right + // properties must be supported by a Citizen Card Environment. Values + // specified as percentages (cf. section 3.5.1.2) should be supported. + + // The padding property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (padding instanceof CssLength) { + Object value = ((CssLength) padding).get(); + if (value instanceof Float) { + return ((Float) value).floatValue() < 0; + } + } else if (padding instanceof CssPercentage) { + Object value = ((CssPercentage) padding).get(); + if (value instanceof Float) { + return ((Float) value).floatValue() < 0; + } + } else if (padding instanceof CssNumber) { + return ((CssNumber) padding).getValue() < 0; + } + + return false; + + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java new file mode 100644 index 00000000..bc113bfe --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssPaddingTopSLXHTML.java @@ -0,0 +1,61 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssPaddingSide; +import org.w3c.css.properties.css1.CssPaddingTop; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; + +public class CssPaddingTopSLXHTML extends CssPaddingTop { + + public CssPaddingTopSLXHTML() { + } + + public CssPaddingTopSLXHTML(CssPaddingSide another) { + super(another); + } + + public CssPaddingTopSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + // The padding-top, padding-bottom, padding-left and padding-right + // properties must be supported by a Citizen Card Environment. Values + // specified as percentages (cf. section 3.5.1.2) should be supported. + + // The padding property may be supported by a Citizen Card Environment. + + // An instance document must not contain a negative value in the properties + // mentioned above. Otherwise it must be rejected by the Citizen Card + // Environment. + + if (CssPaddingSLXHTML.isDisallowedValue(getValue())) { + throw new SLXHTMLInvalidParamException("padding", getValue(), + getPropertyName(), ac); + } + + } + + public CssPaddingTopSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + super(ac, expression); + // TODO Auto-generated constructor stub + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssTextDecorationSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssTextDecorationSLXHTML.java new file mode 100644 index 00000000..16b9780a --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssTextDecorationSLXHTML.java @@ -0,0 +1,51 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssTextDecoration; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssValue; + +public class CssTextDecorationSLXHTML extends CssTextDecoration { + + public CssTextDecorationSLXHTML() { + } + + public CssTextDecorationSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + if (get() instanceof CssValue) { + if ("blink".equalsIgnoreCase(((CssValue) get()).toString())) { + throw new SLXHTMLInvalidParamException("text-decoration", "blink", ac); + } + } else if (get() instanceof String) { + if ("blink".equalsIgnoreCase((String) get())) { + throw new SLXHTMLInvalidParamException("text-decoration", "blink", ac); + } + } + + } + + public CssTextDecorationSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssWordSpacingSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssWordSpacingSLXHTML.java new file mode 100644 index 00000000..a497f4e3 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/CssWordSpacingSLXHTML.java @@ -0,0 +1,54 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css1.CssWordSpacing; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssLength; +import org.w3c.css.values.CssNumber; + +public class CssWordSpacingSLXHTML extends CssWordSpacing { + + public CssWordSpacingSLXHTML() { + } + + public CssWordSpacingSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + Object value = get(); + if (value instanceof CssLength) { + Object length = ((CssLength) value).get(); + if (length instanceof Float && ((Float) length).floatValue() < 0) { + throw new SLXHTMLInvalidParamException("spacing", length, getPropertyName(), ac); + } + } else if (value instanceof CssNumber) { + if (((CssNumber) value).getValue() < 0) { + throw new SLXHTMLInvalidParamException("spacing", value, getPropertyName(), ac); + } + } + + } + + public CssWordSpacingSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLInvalidParamException.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLInvalidParamException.java new file mode 100644 index 00000000..edac03f4 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLInvalidParamException.java @@ -0,0 +1,71 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import java.text.MessageFormat; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.w3c.css.util.ApplContext; + +public class SLXHTMLInvalidParamException extends + org.w3c.css.util.InvalidParamException { + + private static final long serialVersionUID = 1L; + + protected String message; + + public SLXHTMLInvalidParamException() { + } + + public SLXHTMLInvalidParamException(String error, ApplContext ac) { + setMessage(error, null, ac); + } + + public SLXHTMLInvalidParamException(String error, Object message, ApplContext ac) { + setMessage(error, new Object[] {message}, ac); + } + + public SLXHTMLInvalidParamException(String error, Object message1, Object message2, + ApplContext ac) { + setMessage(error, new Object[] {message1, message2}, ac); + } + + @Override + public String getMessage() { + return getLocalizedMessage(); + } + + @Override + public String getLocalizedMessage() { + return message; + } + + protected void setMessage(String error, Object[] arguments, ApplContext ac) { + Locale locale = new Locale(ac.getContentLanguage()); + ResourceBundle bundle = ResourceBundle.getBundle("at/gv/egiz/bku/slxhtml/css/Messages", locale); + String pattern; + try { + pattern = bundle.getString(error); + } catch (MissingResourceException e) { + pattern = "Can't find error message for : " + error; + } + message = MessageFormat.format(pattern, arguments); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java new file mode 100644 index 00000000..99448ec4 --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/SLXHTMLStyle.java @@ -0,0 +1,22 @@ +// +// $Id: Css2Style.java,v 1.2 2005-09-08 12:24:01 ylafon Exp $ +// From Philippe Le Hegaret (Philippe.Le_Hegaret@sophia.inria.fr) +// +// (c) COPYRIGHT MIT and INRIA, 1997. +// Please first read the full copyright statement in file COPYRIGHT.html +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.aural.ACssStyle; +import org.w3c.css.parser.CssPrinterStyle; + +/** + * @version $Revision: 1.2 $ + */ +public class SLXHTMLStyle extends ACssStyle { + + public void print(CssPrinterStyle printer) { + super.print(printer); + } + + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/TableLayoutSLXHTML.java b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/TableLayoutSLXHTML.java new file mode 100644 index 00000000..50f30cce --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/slxhtml/css/TableLayoutSLXHTML.java @@ -0,0 +1,45 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import org.w3c.css.properties.css2.table.TableLayout; +import org.w3c.css.util.ApplContext; +import org.w3c.css.util.InvalidParamException; +import org.w3c.css.values.CssExpression; +import org.w3c.css.values.CssIdent; + +public class TableLayoutSLXHTML extends TableLayout { + + public TableLayoutSLXHTML() { + } + + public TableLayoutSLXHTML(ApplContext ac, CssExpression expression, + boolean check) throws InvalidParamException { + super(ac, expression, check); + + if (new CssIdent("fixed").equals(get())) { + throw new SLXHTMLInvalidParamException("table-layout", "fixed", getPropertyName(), ac); + } + + } + + public TableLayoutSLXHTML(ApplContext ac, CssExpression expression) + throws InvalidParamException { + this(ac, expression, false); + } + +} diff --git a/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java b/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java new file mode 100644 index 00000000..5108140d --- /dev/null +++ b/BKUViewer/src/main/java/at/gv/egiz/bku/text/TextValidator.java @@ -0,0 +1,32 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.text; + +import java.io.InputStream; + +import at.gv.egiz.bku.viewer.ValidationException; +import at.gv.egiz.bku.viewer.Validator; + +public class TextValidator implements Validator { + + @Override + public void validate(InputStream is, String charset) + throws ValidationException { + // TODO: implement character validation + } + +} diff --git a/BKUViewer/src/main/resources/META-INF/services/at.gv.egiz.bku.viewer.Validator b/BKUViewer/src/main/resources/META-INF/services/at.gv.egiz.bku.viewer.Validator new file mode 100644 index 00000000..0004949b --- /dev/null +++ b/BKUViewer/src/main/resources/META-INF/services/at.gv.egiz.bku.viewer.Validator @@ -0,0 +1,2 @@ +application/xhtml+xml at.gv.egiz.bku.slxhtml.SLXHTMLValidator +text/plain at.gv.egiz.bku.text.TextValidator \ No newline at end of file diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml-model-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml-model-1.xsd new file mode 100644 index 00000000..89e91faa --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml-model-1.xsd @@ -0,0 +1,469 @@ + + + + + + This is the XML Schema module of common content models for SLXHTML. + SLXHTML is a profile of XHTML (see W3C copyright notice below). + + @author: Gregor Karlinger gregor.karlinger@cio.gv.at + $Id: slxhtml-model-1.xsd,v 1.4 2004/05/12 11:35:31 karlinger Exp $ + + + + + + XHTML Document Model + This module describes the groupings of elements/attributes + that make up common content models for XHTML elements. + XHTML has following basic content models: + xhtml.Inline.mix; character-level elements + xhtml.Block.mix; block-like elements, e.g., paragraphs and lists + xhtml.Flow.mix; any block or inline elements + xhtml.HeadOpts.mix; Head Elements + xhtml.InlinePre.mix; Special class for pre content model + xhtml.InlineNoAnchor.mix; Content model for Anchor + + Any groups declared in this module may be used to create + element content models, but the above are considered 'global' + (insofar as that term applies here). XHTML has the + following Attribute Groups + xhtml.Core.extra.attrib + xhtml.I18n.extra.attrib + xhtml.Common.extra + + The above attribute Groups are considered Global + + + + + + + SLXHTML 1.2: attributeGroup "dir.attrib" removed. + + + + + + + + SLXHTML 1.2: attributeGroup "style.attrib" removed. + + + + + + + + + + Extended Global Core Attributes + + + + + Extended Global I18n attributes + + + + + Extended Global Common Attributes + + + + + + + SLXHTML 1.2: elements "script", "meta", "link", "object" removed. + + + + + + + + + + + SLXHTML 1.2: Only a single instance of element "style" is + allowed apart from the obligatory "title" element. + + + + + + + + + + + + SLXHTML 1.2: elements "ins", "del" removed. + + + + + + + + + SLXHTML 1.2: elements "script", "noscript" removed. + + + + + + + + + + + + + + + + + + + + + + + + + + SLXHTML 1.2: elements "dfn", "samp", "kbd", "var", "q" , "abbr" and + "acronym" removed. + + + + + + + + + + + + + SLXHTML 1.2: elements "tt", "i", "b", "big", "small", "sub", "sup" removed. + + + + + + + + SLXHTML 1.2: element "bdo" removed. + + + + + + + + SLXHTML 1.2: element "a" removed. + + + + + + + + SLXHTML 1.2: elements "map", "object" removed. + + + + + + + + + + SLXHTML 1.2: elements "input", "select", "textara", "lable", "button" removed. + + + + + + + + + + + SLXHTML 1.2: element "ruby" removed. + + + + + + + + + + + + + + + + + + + + + + SLXHTML 1.2: elements "tt", "i", "b", "script", "map" removed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SLXHTML 1.2: element "form" removed. + + + + + + + + + SLXHTML 1.2: element "fieldset" removed. + + + + + + + + + + + + + + + + SLXHTML 1.2: element "address" removed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml-modules-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml-modules-1.xsd new file mode 100644 index 00000000..016833be --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml-modules-1.xsd @@ -0,0 +1,248 @@ + + + + + + + This XML Schema declares changes to the content models + of modules included in SLXHTML 1.2 + + + + + + + Module Content Model Redefinitions + + This schema describes the changes (Redefinitions) to the + content model of individual modules as they are instantiated as part of + SLXHTML 1.2 Document + + + + + + + + + + + + + Redefinition by SLXHTML 1.2: Removed xml:lang attrib. + + + + + + + + + Redefinition by SLXHTML 1.2: Removed title attrib. + + + + + + + + + + + + + + + + + + Redefinition by SLXHTML 1.2: Removed cite attrib. + + + + + + + + + + + + + + + + + + + + + Redefinition by SLXHTML 1.2: Change value of the version attrib. + + + + + + + + + Redefinition by SLXHTML 1.2: Removed profile attrib. + + + + + + + + + + + + + + + + + Redefinition by SLXHTML 1.2: Removed attributes "longdesc", "height", "width". + + + + + + + + + + + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute group "title" + Removed attribute "xml:space" + Fixed value of attribute "type" + Fixed value of attribute "media" + + + + + + + + + + + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "scope.attrib", "CellHAlign.attrib", "CellVAlign.attrib" + Removed attributes "abbr", "axis", "headers" + + + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "scope.attrib", "CellHAlign.attrib", "CellVAlign.attrib" + Removed attributes "abbr", "axis", "headers" + + + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "CellHAlign.attrib", "CellVAlign.attrib" + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "CellHAlign.attrib", "CellVAlign.attrib" + Removed attributes "span", "width" + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "CellHAlign.attrib", "CellVAlign.attrib" + Removed attributes "span", "width" + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "CellHAlign.attrib", "CellVAlign.attrib" + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "CellHAlign.attrib", "CellVAlign.attrib" + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "CellHAlign.attrib", "CellVAlign.attrib" + + + + + + + + + Redefinition by SLXHTML 1.2: + Removed attribute groups "frame.attrib", "rules.attrib" + Removed attributes "summary", "width", "border", "cellspacing", "cellpadding" + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml.xsd new file mode 100644 index 00000000..555edb52 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/slxhtml.xsd @@ -0,0 +1,70 @@ + + + + + This is the XML Schema driver for SLXHTML 1.2. + SLXHTML is a profile of XHTML (see W3C copyright notice below). + + @author: Gregor Karlinger gregor.karlinger@cio.gv.at + $Id: slxhtml.xsd,v 1.3 2004/05/12 11:35:31 karlinger Exp $ + + + + + This is the Schema Driver file for SLXHTML 1.2 + Document Type + + This schema includes + + modules for SLXHTML 1.2 Document Type. + + + schema that defines all the named model for + the SLXHTML 1.2 Document Type + + + schema that redefines the content model of + individual elements defined in the Module + implementations. + + SLXHTML 1.2 Document Type includes the following Modules + + XHTML Core modules + + text + + lists + + structure + + Other XHTML modules + + Style + + Image + + Tables + + + + + + + + This import brings in the XML namespace attributes + The XML attributes are used by various modules + + + + + + + + This schema redefines the content model defined by + the individual modules for SLXHTML 1.2 Document Type + + + + + + + + Document Model module for the SLXHTML 1.2 Document Type. + This schema file defines all named models used by XHTML + Modularization Framework for SLXHTML 1.2 Document Type + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-attribs-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-attribs-1.xsd new file mode 100644 index 00000000..df5ce483 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-attribs-1.xsd @@ -0,0 +1,72 @@ + + + + + + + This is the XML Schema common attributes module for XHTML + $Id: xhtml-attribs-1.xsd,v 1.6 2005/09/26 23:37:47 ahby Exp $ + + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkphras-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkphras-1.xsd new file mode 100644 index 00000000..da15e4c1 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkphras-1.xsd @@ -0,0 +1,161 @@ + + + + + + + + + This is the XML Schema Block Phrasal support module for XHTML + $Id: xhtml-blkphras-1.xsd,v 1.6 2006/09/11 10:27:50 ahby Exp $ + + + + + + Block Phrasal + This module declares the elements and their attributes used to + support block-level phrasal markup. + This is the XML Schema block phrasal elements module for XHTML + + * address, blockquote, pre, h1, h2, h3, h4, h5, h6 + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkpres-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkpres-1.xsd new file mode 100644 index 00000000..cf42303a --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkpres-1.xsd @@ -0,0 +1,37 @@ + + + + + + This is the XML SchemaBlock presentation element module for XHTML + $Id: xhtml-blkpres-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + Block Presentational Elements + + * hr + + This module declares the elements and their attributes used to + support block-level presentational markup. + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkstruct-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkstruct-1.xsd new file mode 100644 index 00000000..1e658580 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-blkstruct-1.xsd @@ -0,0 +1,49 @@ + + + + + + Block Structural + + * div, p + + This module declares the elements and their attributes used to + support block-level structural markup. + + This is the XML Schema Block Structural module for XHTML + $Id: xhtml-blkstruct-1.xsd,v 1.3 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-datatypes-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-datatypes-1.xsd new file mode 100644 index 00000000..5943cf35 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-datatypes-1.xsd @@ -0,0 +1,175 @@ + + + + + XHTML Datatypes + This is the XML Schema datatypes module for XHTML + + Defines containers for the XHTML datatypes, many of + these imported from other specifications and standards. + + $Id: xhtml-datatypes-1.xsd,v 1.9 2008/06/04 20:58:09 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-framework-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-framework-1.xsd new file mode 100644 index 00000000..05b906d4 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-framework-1.xsd @@ -0,0 +1,66 @@ + + + + + This is the XML Schema Modular Framework support module for XHTML + $Id: xhtml-framework-1.xsd,v 1.5 2005/09/26 23:37:47 ahby Exp $ + + + + + + XHTML Modular Framework + This required module instantiates the necessary modules + needed to support the XHTML modularization framework. + + The Schema modules instantiated are: + + notations + + datatypes + + common attributes + + character entities + + + + + + + + This module defines XHTML Attribute DataTypes + + + + + + + + This module defines Common attributes for XHTML + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-image-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-image-1.xsd new file mode 100644 index 00000000..cd16bc9b --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-image-1.xsd @@ -0,0 +1,45 @@ + + + + + + + Images + This is the XML Schema Images module for XHTML + + * img + + This module provides markup to support basic image embedding. + + To avoid problems with text-only UAs as well as to make + image content understandable and navigable to users of + non-visual UAs, you need to provide a description with + the 'alt' attribute, and avoid server-side image maps. + + + $Id: xhtml-image-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlphras-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlphras-1.xsd new file mode 100644 index 00000000..919c59de --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlphras-1.xsd @@ -0,0 +1,163 @@ + + + + + + + This is the XML Schema Inline Phrasal support module for XHTML + $Id: xhtml-inlphras-1.xsd,v 1.4 2005/09/26 22:54:53 ahby Exp $ + + + + + + Inline Phrasal. + This module declares the elements and their attributes used to + support inline-level phrasal markup. + This is the XML Schema Inline Phrasal module for XHTML + + * abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var + + $Id: xhtml-inlphras-1.xsd,v 1.4 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlpres-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlpres-1.xsd new file mode 100644 index 00000000..a053447c --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlpres-1.xsd @@ -0,0 +1,39 @@ + + + + + + This is the XML Schema Inline Presentation element module for XHTML + $Id: xhtml-inlpres-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + Inline Presentational Elements + + * b, big, i, small, sub, sup, tt + + This module declares the elements and their attributes used to + support inline-level presentational markup. + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlstruct-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlstruct-1.xsd new file mode 100644 index 00000000..635eb5f1 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-inlstruct-1.xsd @@ -0,0 +1,50 @@ + + + + + + This is the XML Schema Inline Structural support module for XHTML + $Id: xhtml-inlstruct-1.xsd,v 1.4 2005/09/26 22:54:53 ahby Exp $ + + + + + + Inline Structural. + This module declares the elements and their attributes + used to support inline-level structural markup. + This is the XML Schema Inline Structural element module for XHTML + + * br, span + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-list-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-list-1.xsd new file mode 100644 index 00000000..cc22ba88 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-list-1.xsd @@ -0,0 +1,99 @@ + + + + + + List Module + This is the XML Schema Lists module for XHTML + List Module Elements + + * dl, dt, dd, ol, ul, li + + This module declares the list-oriented element types + and their attributes. + $Id: xhtml-list-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-pres-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-pres-1.xsd new file mode 100644 index 00000000..bc36fc48 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-pres-1.xsd @@ -0,0 +1,51 @@ + + + + + + This is the XML Schema Presentation module for XHTML + This is a REQUIRED module. + $Id: xhtml-pres-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + Presentational Elements + + This module defines elements and their attributes for + simple presentation-related markup. + + Elements defined here: + + * hr + * b, big, i, small, sub, sup, tt + + + + + + + Block Presentational module + Elements defined here: + + * hr + + + + + + + Inline Presentational module + Elements defined here: + + * b, big, i, small, sub, sup, tt + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-struct-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-struct-1.xsd new file mode 100644 index 00000000..60cbcbf5 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-struct-1.xsd @@ -0,0 +1,116 @@ + + + + + + This is the XML Schema Document Structure module for XHTML + Document Structure + + * title, head, body, html + + The Structure Module defines the major structural elements and + their attributes. + + $Id: xhtml-struct-1.xsd,v 1.8 2006/09/11 10:27:50 ahby Exp $ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-style-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-style-1.xsd new file mode 100644 index 00000000..1b3e7d3b --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-style-1.xsd @@ -0,0 +1,53 @@ + + + + + + + This is the XML Schema Stylesheets module for XHTML + $Id: xhtml-style-1.xsd,v 1.5 2006/09/11 10:14:57 ahby Exp $ + + + + + + Stylesheets + + * style + + This module declares the style element type and its attributes, + used to embed stylesheet information in the document head element. + + + + + + + This import brings in the XML namespace attributes + The module itself does not provide the schemaLocation + and expects the driver schema to provide the + actual SchemaLocation. + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-table-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-table-1.xsd new file mode 100644 index 00000000..ec76db3c --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-table-1.xsd @@ -0,0 +1,272 @@ + + + + + + + This is the XML Schema Tables module for XHTML + $Id: xhtml-table-1.xsd,v 1.3 2005/09/26 22:54:53 ahby Exp $ + + + + + + Tables + + * table, caption, thead, tfoot, tbody, colgroup, col, tr, th, td + + This module declares element types and attributes used to provide + table markup similar to HTML 4.0, including features that enable + better accessibility for non-visual user agents. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-text-1.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-text-1.xsd new file mode 100644 index 00000000..432bdad7 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xhtml-text-1.xsd @@ -0,0 +1,67 @@ + + + + + + Textual Content + This is the XML Schema Text module for XHTML + + The Text module includes declarations for all core + text container elements and their attributes. + + + block phrasal + + block structural + + inline phrasal + + inline structural + + $Id: xhtml-text-1.xsd,v 1.2 2005/09/26 22:54:53 ahby Exp $ + + + + + + + + Block Phrasal module + Elements defined here: + + * address, blockquote, pre, h1, h2, h3, h4, h5, h6 + + + + + + + Block Structural module + Elements defined here: + + * div, p + + + + + + + Inline Phrasal module + Elements defined here: + + * abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var + + + + + + + Inline Structural module + Elements defined here: + + * br,span + + + + diff --git a/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xml.xsd b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xml.xsd new file mode 100644 index 00000000..eeb9db56 --- /dev/null +++ b/BKUViewer/src/main/resources/at/gv/egiz/bku/slxhtml/xml.xsd @@ -0,0 +1,145 @@ + + + + + + See http://www.w3.org/XML/1998/namespace.html and + http://www.w3.org/TR/REC-xml for information about this namespace. + + This schema document describes the XML namespace, in a form + suitable for import by other schema documents. + + Note that local names in this namespace are intended to be defined + only by the World Wide Web Consortium or its subgroups. The + following names are currently defined in this namespace and should + not be used with conflicting semantics by any Working Group, + specification, or document instance: + + base (as an attribute name): denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification. + + id (as an attribute name): denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification. + + lang (as an attribute name): denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification. + + space (as an attribute name): denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification. + + Father (in any context at all): denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: + + In appreciation for his vision, leadership and dedication + the W3C XML Plenary on this 10th day of February, 2000 + reserves for Jon Bosak in perpetuity the XML name + xml:Father + + + + + This schema defines attributes and an attribute group + suitable for use by + schemas wishing to allow xml:base, xml:lang, xml:space or xml:id + attributes on elements they define. + + To enable this, such a schema must import this schema + for the XML namespace, e.g. as follows: + <schema . . .> + . . . + <import namespace="http://www.w3.org/XML/1998/namespace" + schemaLocation="http://www.w3.org/2001/xml.xsd"/> + + Subsequently, qualified reference to any of the attributes + or the group defined below will have the desired effect, e.g. + + <type . . .> + . . . + <attributeGroup ref="xml:specialAttrs"/> + + will define a type which will schema-validate an instance + element with any of those attributes + + + + In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + http://www.w3.org/2007/08/xml.xsd. + At the date of issue it can also be found at + http://www.w3.org/2001/xml.xsd. + The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML Schema + itself, or with the XML namespace itself. In other words, if the XML + Schema or XML namespaces change, the version of this document at + http://www.w3.org/2001/xml.xsd will change + accordingly; the version at + http://www.w3.org/2007/08/xml.xsd will not change. + + + + + + Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. See + RFC 3066 at http://www.ietf.org/rfc/rfc3066.txt and the IANA registry + at http://www.iana.org/assignments/lang-tag-apps.htm for + further information. + + The union allows for the 'un-declaration' of xml:lang with + the empty string. + + + + + + + + + + + + + + + + + + + + + + + + See http://www.w3.org/TR/xmlbase/ for + information about this attribute. + + + + + + See http://www.w3.org/TR/xml-id/ for + information about this attribute. + + + + + + + + + + + diff --git a/BKUViewer/src/main/resources/org/w3c/css/properties/Config.properties b/BKUViewer/src/main/resources/org/w3c/css/properties/Config.properties new file mode 100644 index 00000000..0ece8cda --- /dev/null +++ b/BKUViewer/src/main/resources/org/w3c/css/properties/Config.properties @@ -0,0 +1,32 @@ +# configuration file for org.w3c.css.parser.CssFouffa +# Properties should be in the style directory + +# Is the parser should run in CSS2 ? +extended-parser: true + +# the CssStyle to use +#style for CSS1 +css1: org.w3c.css.properties.css1.Css1Style +#style for CSS2 (and mobile profile and TV profile) +css2: org.w3c.css.properties.css2.font.Css2Style +#style for CSS2.1 +css21: org.w3c.css.properties.css21.Css21Style +#style for CSS3 +css3: org.w3c.css.properties.css3.Css3Style +#SVG styles +svg : org.w3c.css.properties.svg.SVGStyle +svgbasic : org.w3c.css.properties.svg.SVGBasicStyle +svgtiny : org.w3c.css.properties.svg.SVGTinyStyle +#ATSC style +atsc-tv: org.w3c.css.properties.atsc.ATSCStyle +#SLXHMTL +slxhtml: at.gv.egiz.bku.slxhtml.css.SLXHTMLStyle + +#media +media: Media.properties + +# file containing the properties files for each profile +profilesProperties: ProfilesProperties.properties + +#default profile +defaultProfile: css21 diff --git a/BKUViewer/src/main/resources/org/w3c/css/properties/ProfilesProperties.properties b/BKUViewer/src/main/resources/org/w3c/css/properties/ProfilesProperties.properties new file mode 100644 index 00000000..8c2aded8 --- /dev/null +++ b/BKUViewer/src/main/resources/org/w3c/css/properties/ProfilesProperties.properties @@ -0,0 +1,30 @@ +# The list of properties to use + +# properties for CSS1 +css1 : CSS1Properties.properties + +# properties for CSS2 +css2 : CSS2Properties.properties + +# properties for CSS2.1 +css21 : CSS21Properties.properties + +# properties for CSS3 +css3 : CSS3Properties.properties + +# properties for mobile profile +mobile : MobileProperties.properties + +# properties for ATSC TV profile +atsc-tv : ATSCProperties.properties + +# properties for TV profile +tv : TVProperties.properties + +# properties for SVG profiles +svg : SVGProperties.properties +svgbasic : SVGBasicProperties.properties +svgtiny : SVGTinyProperties.properties + +# properties for SLXHTML profile +slxhtml : SLXHTMLProperties.properties diff --git a/BKUViewer/src/main/resources/org/w3c/css/properties/SLXHTMLProperties.properties b/BKUViewer/src/main/resources/org/w3c/css/properties/SLXHTMLProperties.properties new file mode 100644 index 00000000..dec68c11 --- /dev/null +++ b/BKUViewer/src/main/resources/org/w3c/css/properties/SLXHTMLProperties.properties @@ -0,0 +1,641 @@ +# All properties for all media + +# CSS2 Properties + +# Margin spacing +# +# The margin-top, margin-bottom, margin-left and margin-right properties +# must be supported by a Citizen Card Environment. Values specified as percentages +# (cf. section 3.5.1.2) should be supported. +# +# The margin property may be supported by a Citizen Card Environment. +# +# An instance document must not contain a negative value in the properties mentioned +# above. Otherwise it must be rejected by the Citizen Card Environment. + +margin-top: at.gv.egiz.bku.slxhtml.css.CssMarginTopSLXHTML +margin-bottom: at.gv.egiz.bku.slxhtml.css.CssMarginBottomSLXHTML +margin-left: at.gv.egiz.bku.slxhtml.css.CssMarginLeftSLXHTML +margin-right: at.gv.egiz.bku.slxhtml.css.CssMarginRightSLXHTML +margin: at.gv.egiz.bku.slxhtml.css.CssMarginSLXHTML + +# Padding spacing +# +# The padding-top, padding-bottom, padding-left and padding-right properties must be +# supported by a Citizen Card Environment. Values specified as percentages (cf. section +# 3.5.1.2) should be supported. +# +# The padding property may be supported by a Citizen Card Environment. +# +# An instance document must not contain a negative value in the properties +# mentioned above. Otherwise it must be rejected by the Citizen Card Environment. + +padding-top: at.gv.egiz.bku.slxhtml.css.CssPaddingTopSLXHTML +padding-bottom: at.gv.egiz.bku.slxhtml.css.CssPaddingBottomSLXHTML +padding-left: at.gv.egiz.bku.slxhtml.css.CssPaddingLeftSLXHTML +padding-right: at.gv.egiz.bku.slxhtml.css.CssPaddingRightSLXHTML +padding: at.gv.egiz.bku.slxhtml.css.CssPaddingSLXHTML + +# +# Borders +# + +# Border width +# +# The border-top-width, border-bottom-width, border-left-width, border-right-width +# and border-width properties should be supported by a Citizen Card Environment. If +# the properties are supported, the predefined values thin, medium and thick should +# also be supported (cf. [CSS 2], section 8.5.1). + +border-top-width: org.w3c.css.properties.css1.CssBorderTopWidthCSS2 +border-right-width: org.w3c.css.properties.css1.CssBorderRightWidthCSS2 +border-left-width: org.w3c.css.properties.css1.CssBorderLeftWidthCSS2 +border-bottom-width: org.w3c.css.properties.css1.CssBorderBottomWidthCSS2 + +# Border colour +# +# The border-top-color, border-bottom-color, border-left-color, border-right-color +# and border-color properties should be supported by a Citizen Card Environment. The +# predefined value transparent for the border-color property may be supported (cf. +# [CSS 2], section 8.5.2). + +border-top-color: at.gv.egiz.bku.slxhtml.css.CssBorderTopColorSLXHTML +border-right-color: at.gv.egiz.bku.slxhtml.css.CssBorderRightColorSLXHTML +border-left-color: at.gv.egiz.bku.slxhtml.css.CssBorderLeftColorSLXHTML +border-bottom-color: at.gv.egiz.bku.slxhtml.css.CssBorderBottomColorSLXHTML + +# Border style +# +# The border-top-style, border-bottom-style, border-left-style, border-right-style and +# border-style properties should be supported by a Citizen Card Environment. If the properties +# are supported, the predefined values none, dashed, dotted, solid and double should also +# be supported; all other values may be supported (cf. [CSS 2], section 8.5.3). + +border-top-style: org.w3c.css.properties.css1.CssBorderTopStyleCSS2 +border-right-style: org.w3c.css.properties.css1.CssBorderRightStyleCSS2 +border-left-style: org.w3c.css.properties.css1.CssBorderLeftStyleCSS2 +border-bottom-style: org.w3c.css.properties.css1.CssBorderBottomStyleCSS2 + +# Shorthand +# +# The properties for the shorthand version of the border properties (border-top, +# border-bottom, border-left, border-right and border (cf. [CSS 2], section 8.5.4) +# should be supported by a Citizen Card Environment. The recommended values result +# from the three previous sections. + +border-width: org.w3c.css.properties.css1.CssBorderWidthCSS2 +border-color: at.gv.egiz.bku.slxhtml.css.CssBorderColorSLXHTML +border-style: org.w3c.css.properties.css1.CssBorderStyleCSS2 +border-top: org.w3c.css.properties.css1.CssBorderTopCSS2 +border-right: org.w3c.css.properties.css1.CssBorderRightCSS2 +border-left: org.w3c.css.properties.css1.CssBorderLeftCSS2 +border-bottom: org.w3c.css.properties.css1.CssBorderBottomCSS2 +border: at.gv.egiz.bku.slxhtml.css.CssBorderSLXHTML + +# +# Positioning of boxes +# + +# Box type +# +# The property for controlling the box type (display) may be supported by a Citizen +# Card Environment (cf. [CSS 2], section 9.2). + +display: org.w3c.css.properties.css1.CssDisplayCSS2 + +# Positioning scheme +# +# The property for defining the positioning scheme for a box (position, cf. [CSS 2], +# section 9.3) must not be contained in an instance document to prevent content +# from overlapping. Otherwise the instance document must be rejected by the Citizen +# Card Environment. + +#! position: org.w3c.css.properties.css1.CssPosition + +# Box spacing +# +# The property for defining the positioning scheme for a box (top, bottom, left, right; +# cf. [CSS 2], section 9.3) must not be contained in an instance document to prevent +# content from overlapping. Otherwise the instance document must be rejected by the +# Citizen Card Environment. + +#! top: org.w3c.css.properties.css1.CssTop +#! right: org.w3c.css.properties.css1.CssRight +#! left: org.w3c.css.properties.css1.CssLeft +#! bottom: org.w3c.css.properties.css1.CssBottom + +# Flow around boxes +# +# The properties for defining the flow around boxes (float, clear) may be supported by +# a Citizen Card Environment (cf. [CSS 2], section 9.5). + +float: org.w3c.css.properties.css1.CssFloat +clear: org.w3c.css.properties.css1.CssClear + +# Positioning of boxes on the z-axis +# +# The property for defining the positioning of boxes on the z-axis (z-index, cf. [CSS 2], +# section 9.9) must not be contained in an instance document to prevent content from +# overlapping. Otherwise the instance document must be rejected by the Citizen Card Environment. + +#! z-index: org.w3c.css.properties.css1.CssZIndex + +# Text direction +# +# The properties for controlling the text direction (direction, unicode-bidi) may be +# supported by a Citizen Card Environment (cf. [CSS 2], section 9.10). + +direction: org.w3c.css.properties.css1.CssDirection +unicode-bidi: org.w3c.css.properties.css1.CssUnicodeBidi + +# +# Displaying boxes +# + +# Width and height +# +# The properties for specifying the width and height of a box (width, height, cf. [CSS 2], +# sections 10.2 and 10.5) must not be supported by a Citizen Card Environment to prevent +# content from overlapping. Otherwise the instance document must be rejected by the +# Citizen Card Environment. +# +# The properties for specifying the minimum width and height of a box (min-width, min-height) +# may be supported by a Citizen Card Environment (cf. [CSS 2], sections 10.4 and 10.7). +# +# The properties for specifying the maximum width and height of a box (max-width, max-height, +# cf. [CSS 2], sections 10.4 and 10.7) must not be supported by a Citizen Card Environment +# to prevent content from overlapping. Otherwise the instance document must be rejected by +# the Citizen Card Environment. + +#! width: org.w3c.css.properties.css1.CssWidth +min-width: org.w3c.css.properties.css1.CssMinWidth +#! max-width: org.w3c.css.properties.css1.CssMaxWidth +min-height: org.w3c.css.properties.css1.CssMinHeight +#! max-height: org.w3c.css.properties.css1.CssMaxHeight +#! height: org.w3c.css.properties.css1.CssHeight + +# Line height +# +# The properties for specifying the line height (line-height, vertical-align) should be +# supported by a Citizen Card (cf. [CSS 2], section 10.8). The only exception is the +# vertical-align property: In this case a Citizen Card Environment must be able to interpret +# the values sub and super. + +line-height: org.w3c.css.properties.css1.CssLineHeightCSS2 +vertical-align: org.w3c.css.properties.css1.CssVerticalAlign + +# +# Visible area in boxes +# + +# The property for specifying the visibility of a box (visibility) may be supported by a +# Citizen Card Environment (cf. [CSS 2], section 11). +# +# The properties for controlling the visible area of a box (overflow, clip; cf. [CSS 2], +# section 11) must not be contained in an instance document to prevent hidden content. Otherwise +# the instance document must be rejected by the Citizen Card Environment. + +#! overflow: org.w3c.css.properties.css1.CssOverflow +#! clip: org.w3c.css.properties.css1.CssClip +visibility: org.w3c.css.properties.css1.CssVisibility + +# +# Generated content, numbering, lists +# + +# Generated content +# +# The property for generating content (content) may be supported by a Citizen Card Environment +# (cf. [CSS 2], section 12.2). + +content: org.w3c.css.properties.css1.CssContentCSS2 + +# Displaying quotation marks +# +# The property for displaying quotation marks (quotes) may be supported by a Citizen Card +# Environment (cf. [CSS 2], section 12.3). + +quotes: org.w3c.css.properties.css1.CssQuotes + +# Numbering +# +# The properties for automatic numbering (counter-reset, counter-increment) may be supported +# by a Citizen Card Environment (cf. [CSS 2], section 12.5). + +counter-reset: org.w3c.css.properties.css1.CssCounterReset +counter-increment: org.w3c.css.properties.css1.CssCounterIncrement + +# +# Markers and lists +# + +# Marker spacing +# +# The property for defining the space between a marker and the associated box +# (marker-offset) may be supported by a Citizen Card Environment (cf. [CSS 2], +# section 12.6.1). + +marker-offset: org.w3c.css.properties.css1.CssMarkerOffset + +# List symbols +# +# For the property for selecting the list symbol (list-style-type) a Citizen +# Card Environment must support the values none, disc, circle, square, decimal, +# decimal-leading-zero, lower-roman, upper-roman, lower-alpha, lower-latin, +# upper-alpha and upper-latin. The other values may be supported (cf. [CSS 2], +# section 12.6.2). + +list-style-type: org.w3c.css.properties.css1.CssListStyleTypeCSS2 + +# Position of the list symbol +# +# The property for positioning the list symbol in relation to the associated box +# (list-style-position) should be supported by a Citizen Card Environment (cf. [CSS 2], +# section 12.6.2). + +list-style-position: org.w3c.css.properties.css1.CssListStylePositionCSS2 + +# Image as a list symbol +# +# The property for selecting an image as a list symbol (list-style-image) may be supported +# by a Citizen Card Environment (cf. [CSS 2], section 12.6.2). If the Citizen Card Environment +# supports this property, then it must proceed in respect of the integration of the image +# in the signature as described in section 2.1.7. + +# optional, not supported: +#! list-style-image: org.w3c.css.properties.css1.CssListStyleImageCSS2 + +# Shorthand +# +# The property for the shorthand version of the list properties (list-style) should be supported +# by a Citizen Card Environment. The recommended values result from the explanations for the +# list-style-type, list-style-position and list-style-image properties above (cf. [CSS 2], +# section 12.6.2). + +list-style: org.w3c.css.properties.css1.CssListStyleCSS2 + +# Page-based media +# +# The properties for page-based media may be supported by a Citizen Card Environment (size, marks, +# page-break-before, page-break-inside, page-break-after, page, orphans and widows (cf. [CSS 2], +# section 13). + +page-break-before: org.w3c.css.properties.paged.PageBreakBefore +page-break-after: org.w3c.css.properties.paged.PageBreakAfter +page-break-inside: org.w3c.css.properties.paged.PageBreakInside +page: org.w3c.css.properties.paged.Page +orphans: org.w3c.css.properties.paged.Orphans +widows: org.w3c.css.properties.paged.Widows + +@page.size: org.w3c.css.properties.paged.Size +@page.marks: org.w3c.css.properties.paged.Marks +@page.page-break-before: org.w3c.css.properties.paged.PageBreakBefore +@page.page-break-after: org.w3c.css.properties.paged.PageBreakAfter +@page.page-break-inside: org.w3c.css.properties.paged.PageBreakInside +@page.page: org.w3c.css.properties.paged.Page +@page.orphans: org.w3c.css.properties.paged.Orphans +@page.widows: org.w3c.css.properties.paged.Widows + + +# +# Colours and background +# + +# A Citizen Card Environment must support all the options for specifying a colour listed in [CSS 2], +# section 4.3.6 for a CSS property, if such an option is available for this property according to [CSS 2]. +# +# The exceptions are the system colours (cf. [CSS 2], section 18.2); these must not be used in an +# instance document so as to prevent dependencies on the system environment. Otherwise the instance +# document must be rejected by the Citizen Card Environment. + +# Colour + +# The property for defining the foreground colour of the content of an element (color) must be +# supported by a Citizen Card Environment (cf. [CSS 2], section 14.1). + +color: at.gv.egiz.bku.slxhtml.css.CssColorSLXHTML + +# Background +# +# The property for defining the background colour of the content of an element (background-color) +# must be supported by a Citizen Card Environment (cf. [CSS 2], section 14.2.1). +# +# The properties for selecting and controlling an image as background (background-image, background-repeat, +# background-position, background-attachment; cf. [CSS 2], section 14.2.1) must not be contained in an +# instance document to prevent content from overlapping. Otherwise the instance document must be +# rejected by the Citizen Card Environment. + +# The property for the shorthand version of the background properties (background) should be supported +# by a Citizen Card Environment. The recommended values result from the explanations for the background-color +# property above (cf. [CSS 2], section 14.2.1). If the property contains values for selecting and controlling +# an image as background, the instance document must be rejected by the Citizen Card Environment. + +background-color: at.gv.egiz.bku.slxhtml.css.CssBackgroundColorSLXHTML +#! background-image: org.w3c.css.properties.css1.CssBackgroundImageCSS2 +#! background-repeat: org.w3c.css.properties.css1.CssBackgroundRepeatCSS2 +#! background-attachment: org.w3c.css.properties.css1.CssBackgroundAttachmentCSS2 +#! background-position: org.w3c.css.properties.css1.CssBackgroundPositionCSS2 +background: at.gv.egiz.bku.slxhtml.css.CssBackgroundSLXHTML + +# +# Fonts +# +# +# For the property for selecting a font family (font-family), a Citizen Card Environment must +# support the predefined values serif, sans-serif and monospaced for the general font families. +# All other values may be supported by a Citizen Card Environment (cf. [CSS 2], section 15.2.2). +# +# If a preferred font family is specified in the instance document that cannot be displayed by the +# Citizen Card Environment, then the Citizen Card Environment may still display the instance +# document if another displayable font family has been specified as an alternative. For example, +# if the specification in the instance document is font-family: "Times New Roman", serif, then the +# Citizen Card Environment may display the instance document in the secure viewer even if it does +# not know the Times New Roman font family (as it must always support serif). + +font-family: org.w3c.css.properties.css1.CssFontFamilyCSS2 + +# Font style +# +# The properties for defining the font style (font-style) and font weight (font-weight) +# must be supported by a Citizen Card Environment. The values normal and italic must be supported, +# while the value oblique should be supported. +# +# The property for defining the font variant (font-variant) should be supported by a Citizen Card +# Environment, while the property for defining the font stretch (font-stretch) may be supported +# by a Citizen Card Environment (cf. [CSS 2], section 15.2.3). + +font-style: org.w3c.css.properties.css1.CssFontStyleCSS2 +font-weight: org.w3c.css.properties.css1.CssFontWeightCSS2 +font-variant: org.w3c.css.properties.css1.CssFontVariantCSS2 +font-stretch: org.w3c.css.properties.css1.CssFontStretchCSS2 + +# Font size +# +# The property for specifying the font size (font-size) must be supported by a Citizen +# Card Environment. The property for specifying the stretch ratio (font-size-adjust) may +# be supported by a Citizen Card Environment (cf. [CSS 2], section 15.2.4). + +font-size: org.w3c.css.properties.css1.CssFontSizeCSS2 +font-size-adjust: org.w3c.css.properties.css1.CssFontSizeAdjustCSS2 + +# Shorthand +# +# The property for the shorthand version of the font properties (font) should be supported by +# a Citizen Card Environment (cf. [CSS 2], section 15.2.5). The recommended values result from +# the explanations above for the font-style, font-variant, font-weight, font-size and font-family +# properties and the explanations for the line-height property in section 3.5.4.2. +# +# The additional, predefined values relating to the system fonts used (caption, icon, etc.) must +# not be contained in an instance document so as to prevent dependencies on the system environment. +# Otherwise the instance document must be rejected by the Citizen Card Environment. + +font: at.gv.egiz.bku.slxhtml.css.CssFontSLXHTML + +# +# Displaying text +# + +# Non-displayable characters +# +# If the text of an instance document contains a character that cannot be displayed by the +# Citizen Card Environment, then the instance document must be rejected by the Citizen Card +# Environment. The character must not be represented by a placeholder. + +# FIXME: How to implement?! + +# Indent +# +# The property for indenting the first line of a text block (text-indent) should be supported +# by a Citizen Card Environment (cf. [CSS 2], section 16.1). + +text-indent: org.w3c.css.properties.css1.CssTextIndent + +# Alignment +# +# For the property for aligning the content of a text block (text-align) a Citizen Card Environment +# must support the values left, right and center. The value justified should be supported, +# while the specification of a string value may be supported (cf. [CSS 2], section 16.2). + +text-align: org.w3c.css.properties.css1.CssTextAlign + +# Text decoration +# +# For the property for decorating a text (text-decoration; cf. [CSS 2], section 16.3.1) a +# Citizen Card Environment must support the values none, underline and line-through. +# +# The value blink must not be contained in an instance document. Otherwise the instance +# document must be rejected by the Citizen Card Environment. +# +# The other values may be supported by a Citizen Card Environment. + +text-decoration: at.gv.egiz.bku.slxhtml.css.CssTextDecorationSLXHTML + +# Shadows +# +# The property for specifying a text shadow (text-shadow) may be supported by a Citizen Card +# Environment (cf. [CSS 2], section 16.3.2). + +text-shadow: org.w3c.css.properties.css1.CssTextShadow + +# Word and letter spacing +# +# The word-spacing and letter-spacing should be supported by a Citizen Card Environment +# (cf. [CSS 2], section 16.4). +# +# An instance document must not contain negative values in order to prevent content from +# overlapping. Otherwise the instance document must be rejected by the Citizen Card Environment. + +word-spacing: at.gv.egiz.bku.slxhtml.css.CssWordSpacingSLXHTML +letter-spacing: at.gv.egiz.bku.slxhtml.css.CssLetterSpacingSLXHTML + +# Capitalisation +# +# The property for specifying the capitalisation of the text of an element (text-transform) +# may be supported by a Citizen Card Environment (cf. [CSS 2], section 16.5). + +text-transform: org.w3c.css.properties.css1.CssTextTransform + +# White space +# +# The property for the handling of white space within the text of an element (white-space) should +# be supported by a Citizen Card Environment (cf. [CSS 2], section 16.6). + +white-space: org.w3c.css.properties.css1.CssWhiteSpace + +# +# Tables +# + +# Position of caption +# +# A Citizen Card Environment should support the top and bottom properties for the property for +# specifying the position when labelling a table (caption-side); the properties left and right +# may be supported (cf. [CSS 2], section 17.4.1). + +caption-side: org.w3c.css.properties.css2.table.CaptionSide + +# Layout algorithm +# +# The property for defining the layout algorithm for a table (table-layout) may be supported by +# a Citizen Card Environment (cf. [CSS 2], section 17.5.2). +# +# However, the fixed value must not be supported because the layout algorithm selected with it can +# cause content to overlap. +# +# In general, the viewer component of the Citizen Card Environment must use a layout algorithm for a +# table that does not generate an overflow, in other words with which the content of every table +# element can be rendered so that it does not extend beyond the confines of the table element. +# There is an example of such an algorithm in [CSS 2], section 17.5.2, subsection Automatic table layout. + +table-layout: at.gv.egiz.bku.slxhtml.css.TableLayoutSLXHTML +row-span: org.w3c.css.properties.css2.table.RowSpan +column-span: org.w3c.css.properties.css2.table.ColumnSpan + +# Borders +# +# The properties for displaying borders in tables (border-collapse, border-spacing, empty-cells) may +# be supported by a Citizen Card Environment (cf. [CSS 2], section 17.6). + +border-collapse: org.w3c.css.properties.css2.table.BorderCollapse +border-spacing: org.w3c.css.properties.css2.table.BorderSpacing +empty-cells: org.w3c.css.properties.css2.table.EmptyCells + +# Voice output +# +# The property for controlling the voice output of the column headers in a table (speak-header) may +# be supported by a Citizen Card Environment (cf. [CSS 2], section 17.7.1). + +speak-header: org.w3c.css.properties.css2.table.SpeakHeader + +# +# User interface +# + +# Cursor format +# +# The property for controlling the cursor format (cursor; cf. [CSS 2], section 18.1) must not be +# contained in an instance document. Otherwise the instance document must be rejected by the Citizen +# Card Environment. + +#! cursor: org.w3c.css.properties.css2.user.CursorCSS2 + +# Contours +# +# The properties for defining element contours (outline-width, outline-style, outline-color and +# outline; cf. [CSS 2], section 18.4) must not be contained in an instance document. Otherwise the +# instance document must be rejected by the Citizen Card Environment. + +#! outline: org.w3c.css.properties.css2.user.Outline +#! outline-width: org.w3c.css.properties.css2.user.OutlineWidth +#! outline-style: org.w3c.css.properties.css2.user.OutlineStyle +#! outline-color: org.w3c.css.properties.css2.user.OutlineColor + +# +# Aural Properties +# +# The properties for the voice output of a document (cf. [CSS 2], section 19) may be supported +# by a Citizen Card Environment. + +volume: org.w3c.css.properties.aural.ACssVolume +pause-before: org.w3c.css.properties.aural.ACssPauseBefore +pause-after: org.w3c.css.properties.aural.ACssPauseAfter +pause: org.w3c.css.properties.aural.ACssPause +cue-before: org.w3c.css.properties.aural.ACssCueBefore +cue-after: org.w3c.css.properties.aural.ACssCueAfter +cue: org.w3c.css.properties.aural.ACssCue +play-during: org.w3c.css.properties.aural.ACssPlayDuring +voice-family: org.w3c.css.properties.aural.ACssVoiceFamily +elevation: org.w3c.css.properties.aural.ACssElevation +speech-rate: org.w3c.css.properties.aural.ACssSpeechRate +pitch: org.w3c.css.properties.aural.ACssPitch +pitch-range: org.w3c.css.properties.aural.ACssPitchRange +stress: org.w3c.css.properties.aural.ACssStress +richness: org.w3c.css.properties.aural.ACssRichness +speak-punctuation: org.w3c.css.properties.aural.ACssSpeakPunctuation +speak-date: org.w3c.css.properties.aural.ACssSpeakDate +speak-numeral: org.w3c.css.properties.aural.ACssSpeakNumeral +speak-time: org.w3c.css.properties.aural.ACssSpeakTime +speak: org.w3c.css.properties.aural.ACssSpeak +azimuth: org.w3c.css.properties.aural.ACssAzimuth + +# +# @page +# +# The @page rule for defining the page properties for page-based output media may be +# supported by a Citizen Card Environment (cf. [CSS 2], section 13, and section 3.5.7 +# of this document). +# + +@page.margin-top: org.w3c.css.properties.css1.CssMarginTop +@page.margin-bottom: org.w3c.css.properties.css1.CssMarginBottom +@page.margin-left: org.w3c.css.properties.css1.CssMarginLeft +@page.margin-right: org.w3c.css.properties.css1.CssMarginRight +@page.margin: org.w3c.css.properties.css1.CssMargin +@page.padding-top: org.w3c.css.properties.css1.CssPaddingTop +@page.padding-bottom: org.w3c.css.properties.css1.CssPaddingBottom +@page.padding-left: org.w3c.css.properties.css1.CssPaddingLeft +@page.padding-right: org.w3c.css.properties.css1.CssPaddingRight +@page.padding: org.w3c.css.properties.css1.CssPadding +@page.border-top-width: org.w3c.css.properties.css1.CssBorderTopWidthCSS2 +@page.border-right-width: org.w3c.css.properties.css1.CssBorderRightWidthCSS2 +@page.border-left-width: org.w3c.css.properties.css1.CssBorderLeftWidthCSS2 +@page.border-bottom-width: org.w3c.css.properties.css1.CssBorderBottomWidthCSS2 +@page.border-top-color: org.w3c.css.properties.css1.CssBorderTopColorCSS2 +@page.border-right-color: org.w3c.css.properties.css1.CssBorderRightColorCSS2 +@page.border-left-color: org.w3c.css.properties.css1.CssBorderLeftColorCSS2 +@page.border-bottom-color: org.w3c.css.properties.css1.CssBorderBottomColorCSS2 +@page.border-top-style: org.w3c.css.properties.css1.CssBorderTopStyleCSS2 +@page.border-right-style: org.w3c.css.properties.css1.CssBorderRightStyleCSS2 +@page.border-left-style: org.w3c.css.properties.css1.CssBorderLeftStyleCSS2 +@page.border-bottom-style: org.w3c.css.properties.css1.CssBorderBottomStyleCSS2 +@page.border-width: org.w3c.css.properties.css1.CssBorderWidthCSS2 +@page.border-color: org.w3c.css.properties.css1.CssBorderColorCSS2 +@page.border-style: org.w3c.css.properties.css1.CssBorderStyleCSS2 +@page.border-top: org.w3c.css.properties.css1.CssBorderTopCSS2 +@page.border-right: org.w3c.css.properties.css1.CssBorderRightCSS2 +@page.border-left: org.w3c.css.properties.css1.CssBorderLeftCSS2 +@page.border-bottom: org.w3c.css.properties.css1.CssBorderBottomCSS2 +@page.border: org.w3c.css.properties.css1.CssBorderCSS2 +@page.display: org.w3c.css.properties.css1.CssDisplayCSS2 +@page.position: org.w3c.css.properties.css1.CssPosition +@page.z-index: org.w3c.css.properties.css1.CssZIndex +@page.direction: org.w3c.css.properties.css1.CssDirection +@page.unicode-bidi: org.w3c.css.properties.css1.CssUnicodeBidi +@page.top: org.w3c.css.properties.css1.CssTop +@page.right: org.w3c.css.properties.css1.CssRight +@page.left: org.w3c.css.properties.css1.CssLeft +@page.bottom: org.w3c.css.properties.css1.CssBottom +@page.float: org.w3c.css.properties.css1.CssFloat +@page.clear: org.w3c.css.properties.css1.CssClear + +# +# @font-face +# +# The @font-face rule for describing or referencing additional font families (cf. [CSS 2], +# section 15.3) must not be used in an instance document. The viewer component of the Citizen +# Card Environment must reject an instance document containing a @font-face rule. + +#! @font-face.font-style: org.w3c.css.properties.css2.font.FontStyle +#! @font-face.font-variant: org.w3c.css.properties.css2.font.FontVariant +#! @font-face.font-weight: org.w3c.css.properties.css2.font.FontWeight +#! @font-face.font-size: org.w3c.css.properties.css2.font.FontSize +#! @font-face.font-family: org.w3c.css.properties.css2.font.FontFamily +#! @font-face.font-stretch: org.w3c.css.properties.css2.font.FontStretch +#! @font-face.unicode-range: org.w3c.css.properties.css2.font.UnicodeRange +#! @font-face.units-per-em: org.w3c.css.properties.css2.font.UnitsPerEm +#! @font-face.src: org.w3c.css.properties.css2.font.Src +#! @font-face.panose-1: org.w3c.css.properties.css2.font.Panose1 +#! @font-face.stemv: org.w3c.css.properties.css2.font.Stemv +#! @font-face.stemh: org.w3c.css.properties.css2.font.Stemh +#! @font-face.slope: org.w3c.css.properties.css2.font.Slope +#! @font-face.cap-height: org.w3c.css.properties.css2.font.CapHeight +#! @font-face.x-hegiht: org.w3c.css.properties.css2.font.XHeight +#! @font-face.widths: org.w3c.css.properties.css2.font.Widths +#! @font-face.ascent: org.w3c.css.properties.css2.font.Ascent +#! @font-face.descent: org.w3c.css.properties.css2.font.Descent +#! @font-face.bbox: org.w3c.css.properties.css2.font.Bbox +#! @font-face.baseline: org.w3c.css.properties.css2.font.Baseline +#! @font-face.centerline: org.w3c.css.properties.css2.font.Centerline +#! @font-face.definition-src: org.w3c.css.properties.css2.font.DefinitionSrc +#! @font-face.mathline: org.w3c.css.properties.css2.font.Mathline +#! @font-face.topline: org.w3c.css.properties.css2.font.Topline diff --git a/BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/ValidatorTest.java b/BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/ValidatorTest.java new file mode 100644 index 00000000..38c64262 --- /dev/null +++ b/BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/ValidatorTest.java @@ -0,0 +1,66 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml; + +import static org.junit.Assert.*; + +import java.io.InputStream; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.junit.Test; + +import at.gv.egiz.bku.viewer.ValidationException; +import at.gv.egiz.bku.viewer.Validator; +import at.gv.egiz.bku.viewer.ValidatorFactory; + + +public class ValidatorTest { + + private static Log log = LogFactory.getLog(ValidatorTest.class); + + @Test + public void testGetInstance() { + + Validator validator = ValidatorFactory.newValidator("application/xhtml+xml"); + + assertNotNull(validator); + + } + + @Test + public void testValidate() throws ValidationException { + + String slxhtmlFile = "at/gv/egiz/bku/slxhtml/test.xhtml"; + + Validator validator = ValidatorFactory.newValidator("application/xhtml+xml"); + + ClassLoader cl = ValidatorTest.class.getClassLoader(); + InputStream slxhtml = cl.getResourceAsStream(slxhtmlFile); + long t0 = System.currentTimeMillis(); + try { + validator.validate(slxhtml, null); + } catch (ValidationException e) { + e.printStackTrace(); + throw e; + } + long t1 = System.currentTimeMillis(); + log.info("Validated SLXHTML file '" + slxhtmlFile + "' in " + (t1 - t0) + "ms."); + + } + +} diff --git a/BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/css/CssValidatorTest.java b/BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/css/CssValidatorTest.java new file mode 100644 index 00000000..2b4740f9 --- /dev/null +++ b/BKUViewer/src/test/java/at/gv/egiz/bku/slxhtml/css/CssValidatorTest.java @@ -0,0 +1,75 @@ +/* +* Copyright 2008 Federal Chancellery Austria and +* Graz University of Technology +* +* 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. +*/ +package at.gv.egiz.bku.slxhtml.css; + +import static org.junit.Assert.*; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.UnsupportedEncodingException; +import java.util.Locale; +import java.util.Properties; +import java.util.Set; + +import org.junit.Test; + +import at.gv.egiz.bku.viewer.ValidationException; + +public class CssValidatorTest { + + @Test + public void testProperties() throws IOException { + + ClassLoader cs = CssValidatorTest.class.getClassLoader(); + InputStream is = cs.getResourceAsStream("org/w3c/css/properties/SLXHTMLProperties.properties"); + + assertNotNull(is); + + Properties cssProperties = new Properties(); + cssProperties.load(is); + + Set names = cssProperties.stringPropertyNames(); + for (String name : names) { + String className = cssProperties.getProperty(name); + try { + Class.forName(className); + } catch (ClassNotFoundException e) { + fail("Implementation class '" + className + "' for property '" + name + "' not found."); + } + + } + + } + + @Test(expected=ValidationException.class) + public void testValidator() throws UnsupportedEncodingException, ValidationException { + + String css = "@charset \"ABCDEFG\";\n" + + " @import url(http://test.abc/test); * { color: black }"; + ByteArrayInputStream input = new ByteArrayInputStream(css.getBytes("UTF-8")); + + CSSValidatorSLXHTML validator = new CSSValidatorSLXHTML(); + + Locale locale = new Locale("de"); + + validator.validate(input, locale, "Test", 10); + + } + + +} diff --git a/BKUViewer/src/test/resources/at/gv/egiz/bku/slxhtml/test.xhtml b/BKUViewer/src/test/resources/at/gv/egiz/bku/slxhtml/test.xhtml new file mode 100644 index 00000000..cbd29551 --- /dev/null +++ b/BKUViewer/src/test/resources/at/gv/egiz/bku/slxhtml/test.xhtml @@ -0,0 +1,10 @@ + + + + Ein einfaches SLXHTML-Dokument + @font-face { color: red }; p { color: red; } + + + Ich bin ein einfacher Text in rot. + + diff --git a/BKUViewer/src/test/resources/commons-logging.properties b/BKUViewer/src/test/resources/commons-logging.properties new file mode 100644 index 00000000..29292562 --- /dev/null +++ b/BKUViewer/src/test/resources/commons-logging.properties @@ -0,0 +1 @@ +org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger diff --git a/BKUViewer/src/test/resources/log4j.properties b/BKUViewer/src/test/resources/log4j.properties new file mode 100644 index 00000000..053eac17 --- /dev/null +++ b/BKUViewer/src/test/resources/log4j.properties @@ -0,0 +1,19 @@ +# loglever DEBUG, appender STDOUT +log4j.rootLogger=TRACE, STDOUT +#log4j.logger.at.gv.egiz.slbinding.RedirectEventFilter=DEBUG, STDOUT + +# STDOUT appender +log4j.appender.STDOUT=org.apache.log4j.ConsoleAppender +log4j.appender.STDOUT.layout=org.apache.log4j.PatternLayout +#log4j.appender.STDOUT.layout.ConversionPattern=%5p | %d{dd HH:mm:ss,SSS} | %20c | %10t | %m%n +#log4j.appender.STDOUT.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n +log4j.appender.STDOUT.layout.ConversionPattern=%-5p |%d | %t | %c %x- %m%n + +### FILE appender +#log4j.appender.file=org.apache.log4j.RollingFileAppender +#log4j.appender.file.maxFileSize=100KB +#log4j.appender.file.maxBackupIndex=9 +#log4j.appender.file.File=egovbus_ca.log +#log4j.appender.file.threshold=info +#log4j.appender.file.layout=org.apache.log4j.PatternLayout +#log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n \ No newline at end of file -- cgit v1.2.3