Re: Problem with xs:pattern and IsBasicLatin

2008-03-30 Thread Andreas Veithen

Andreas,

The problem comes from the fact that in the XML Schema specification,  
Unicode character blocks are matched by "\p{Is...}" [1], whereas Java  
expects "\p{In...}" [2]. Replacing your pattern by  
"[\p{InBasicLatin}\p{InLatin-1Supplement}]+" should work, but then  
your XSD is no longer compliant. You should raise a JIRA for this  
issue. In the meantime a pragmatic solution could be to write a script  
that replaces "\p{Is" by "\p{In" before feeding the schema to wsdl2java.


Regards,

Andreas


[1] http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/#nt-IsBlock
[2] http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html

Quoting "Weck, Andreas" <[EMAIL PROTECTED]>:


Hallo,

i have the following type-definition in a webservice:


  



  




This generates me a class ( with wsdl2java) with the method:
public void setVerantwortlichePerson_type0(java.lang.String param) {
if
(java.lang.String.valueOf(param).matches("[\\p{IsBasicLatin}\\p{IsLatin-
1Supplement}]+")) {
this.localVerantwortlichePerson_type0 = param;
} else {
throw new java.lang.RuntimeException();
}
}

and if i run my appliction and call the method
setVerantwortlichePerson_type0("Andreas") i get the following Exception:
Exception in thread "main" java.util.regex.PatternSyntaxException:
Unknown character property name {BasicLatin} near index 16
[\p{IsBasicLatin}\p{IsLatin-1Supplement}]+
  ^
So what is here wrong? Can somebody help me???
Regards,
Andreas









-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Problem with xs:pattern and IsBasicLatin

2008-03-27 Thread Weck, Andreas
Hallo,
 
i have the following type-definition in a webservice:


  



  



 
This generates me a class ( with wsdl2java) with the method:
public void setVerantwortlichePerson_type0(java.lang.String param) {
if
(java.lang.String.valueOf(param).matches("[\\p{IsBasicLatin}\\p{IsLatin-
1Supplement}]+")) {
this.localVerantwortlichePerson_type0 = param;
} else {
throw new java.lang.RuntimeException();
}
}
 
and if i run my appliction and call the method
setVerantwortlichePerson_type0("Andreas") i get the following Exception:
Exception in thread "main" java.util.regex.PatternSyntaxException:
Unknown character property name {BasicLatin} near index 16 
[\p{IsBasicLatin}\p{IsLatin-1Supplement}]+
  ^
So what is here wrong? Can somebody help me???
Regards,
Andreas