0

I have an XSD schema with a mistake - in one method first symbol in utf-8 'с'

<xsd:attribute name="сreationDate" type="xsd:dateTime" use="required">

I generate Java classes from this XSD. But when I call this method in project for example:

quittanceType.setСreationDate(stringToXMLGregorianCalendar(new Date));

My project does not compile and I get error:

error: cannot find symbol

    quittanceType.setСreationDate(stringToXMLGregorianCalendar(paymentsToCharge.getCreationDateStr()));
                     ^
  symbol:   method setСreationDate(XMLGregorianCalendar)
  location: variable quittanceType of type QuittanceType

But on Macbook this project compiles successfully. What should I do? Everything seems to be normal encodings.

Thomas Fritsch
  • 9,639
  • 33
  • 37
  • 49
ip696
  • 6,574
  • 12
  • 65
  • 128
  • Note that sticking to ASCII method names is probably better, see the discussion here : https://stackoverflow.com/questions/61615/should-you-use-international-identifiers-in-java-c – Arnaud Nov 22 '18 at 14:33
  • I know actually. You should not think that I took and specially wrote one character in another encoding. I got such a scheme, and it's too late to correct the symbol. And I have no right to do it. – ip696 Nov 22 '18 at 14:43

1 Answers1

0

You should better specify the Java property name using binding file.

<jaxb:bindings
    version="1.0"
    xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" 
    xmlns:xs="http://www.w3.org/2001/XMLSchema">

    <jaxb:bindings 
        schemaLocation=".../myschema.xsd" 
        node="/xs:schema">

        <jaxb:bindings node="xs:complexType[@name='SomeType']/xs:attribute[@name='сreationDate']">
            <jaxb:property name="creationDate"/>
        </jaxb:bindings>
    </jaxb:bindings>

</jaxb:bindings>

I'd also notified the schema authors - in case they would want to correct this.

lexicore
  • 42,748
  • 17
  • 132
  • 221