rquinio / l10n-maven-plugin

:abcd: Maven plugin to validate localization resources in Java properties files
MIT License
3 stars 1 forks source link

References with a certain format to other property keys break the HTML validation #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Have a property AAAA.url.SomeURL
2. Have another one that references the previous property with double squared 
brackets
ex: Some text with a <a href="[[AAAA.url.SomeURL]]"></a>

Expected:
validation OK

Output:
ERROR <XXX.properties><BBBB.text.SomeRes> XHTML validation error: 
cvc-datatype-valid.1.2.1: '[[AAAA.url.SomeURL]]' is not a valid value for 
'anyURI'.
Property value was:[Some text with a <a href="[[AAAA.url.SomeURL]]"></a>]
Formatted value used for validation:[Some text with a <a 
href="[[AAAA.url.SomeURL]]"></a>]

ERROR <XXX.properties><BBBB.text.SomeRes> XHTML validation error: 
cvc-attribute.3: The value '[[AAAA.url.SomeURL]]' of attribute 'href' on 
element 'a' is not valid with respect to its type, 'uri'.
Property value was:[Some text with a <a href="[[AAAA.url.SomeURL]]"></a>]
Formatted value used for validation:[Some text with a <a 
href="[[AAAA.url.SomeURL]]"></a>]

used version:
l10n-maven-plugin-1.7

Original issue reported on code.google.com by mede...@gmail.com on 11 Jul 2014 at 1:52

GoogleCodeExporter commented 9 years ago
Definitely a good pattern to avoid duplication.

Here are some usage I've found on property substitution:
- Apache common configuration interpolation ${key} 
http://commons.apache.org/proper/commons-configuration/userguide/howto_basicfeat
ures.html#Variable_Interpolation
- eproperties ${key} 
https://eproperties.googlecode.com/svn/docs/1.1.1/manual/syntax.html#substitutio
n
- XProperties {key} 
http://www2.sys-con.com/ITSG/virtualcd/Java/archives/0612/mair/index.html

Some support multiple levels of inclusion.

What could be interesting is to check that the substituted value exists or 
raise a validation error or warning ! ^^

Original comment by romain.q...@gmail.com on 11 Jul 2014 at 6:51

GoogleCodeExporter commented 9 years ago

Original comment by romain.q...@gmail.com on 30 Nov 2014 at 9:50

GoogleCodeExporter commented 9 years ago
Changes are included in 1.8

Original comment by romain.q...@gmail.com on 30 Nov 2014 at 11:54