Commit 750b9b4a authored by Fernando Mino's avatar Fernando Mino Committed by Andrea Aime
Browse files

[GEOS-9132] Style Validation fix for i18N.

parent b2872888
......@@ -39,8 +39,31 @@
<xsd:element name="Name" type="xsd:string"/>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Abstract" type="xsd:string"/>
<xsd:element name="Title" type="sld:InternationalStringType"/>
<xsd:element name="Abstract" type="sld:InternationalStringType"/>
<xsd:complexType name="InternationalStringType" mixed="true">
The "InternationalStringType" contains localized elements for the
container element. A "mixed" element-content
model is used with localized value elements and default text value.
<xsd:sequence minOccurs="0" maxOccurs="unbounded">
<xsd:element ref="sld:Localized"/>
<xsd:element name="Localized">
<xsd:extension base="xsd:string">
<xsd:attribute name="lang" type="xsd:string" />
<!-- *********************************************************************** -->
......@@ -31,6 +31,14 @@ public class SLDValidatorTest {
/** Tests validation for Localized tag. See GEOS-9132. */
public void testi18nValid() throws Exception {
SLDValidator validator = new SLDValidator();
List errors = validator.validateSLD(getClass().getResourceAsStream("validi18n.sld"));
void showErrors(List errors) {
for (Exception err : (List<Exception>) errors) {
<?xml version="1.0" encoding="UTF-8"?>
<StyledLayerDescriptor version="1.0.0"
xsi:schemaLocation=" StyledLayerDescriptor.xsd"
<!-- a Named Layer is the basic building block of an SLD document -->
<!-- Styles can have names, titles and abstracts -->
<Title>Default Point
<Localized lang="en">English title</Localized>
<Localized lang="it">Titolo in italiano</Localized>
<Abstract>A sample style that draws a point</Abstract>
<!-- FeatureTypeStyles describe how to render different features -->
<!-- A FeatureTypeStyle for rendering points -->
<Title>Red Square
<Localized lang="en">English title</Localized>
<Localized lang="it">Titolo in italiano</Localized>
<Abstract>A 6 pixel square with a red fill and no stroke</Abstract>
<CssParameter name="fill">#FF0000</CssParameter>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment