If you generate Java code from the XML schema you've posted you'd get
a String as the type for Tipo. How did you obtain the annotated Java code?
Did you call
setTipo( 'O' ) // upper case 'o'
That would explain "79" being marshalled.
-W
On Mon, Mar 2, 2009 at 2:42 PM, Lucas Eskopinski <eskopinski_at_gmail.com>wrote:
>
> I’m having the problem, I would like to find a solution ;).
>
> javax.xml.bind.MarshalException
> - with linked exception:
> [org.xml.sax.SAXParseException: cvc-length-valid: Value '79' with length =
> '2' is not facet-valid with respect to length '1' for type
> '#AnonType_TipoTelefoneType'.]
> at
>
> com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.write(MarshallerImpl.java:304)
> at
>
> com.sun.xml.internal.bind.v2.runtime.MarshallerImpl.marshal(MarshallerImpl.java:230)
> at
>
> javax.xml.bind.helpers.AbstractMarshallerImpl.marshal(AbstractMarshallerImpl.java:96)
>
>
> @XmlElement(name = "Tipo", required = true)
> public Character getTipo() {
> return telefone.getTipo();
> }
>
> public void setTipo(Character tipo) {
> this.telefone.setTipo(tipo);
> }
>
>
> <xs:element name="Tipo">
> <xs:simpleType>
> <xs:restriction base="xs:string">
> <xs:length value="1"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
>
> Any help appreciated,
> Lucas.
> --
> View this message in context:
> http://www.nabble.com/mapping-attributes-java.lang.Character-tp22288321p22288321.html
> Sent from the java.net - jaxb users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
> For additional commands, e-mail: users-help_at_jaxb.dev.java.net
>
>