xjc -d generated -p com.example.book book.xsd
Below is a review of the "online converter" experience compared to professional alternatives.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Employee"> <xs:complexType> <xs:sequence> <xs:element name="id" type="xs:int"/> <xs:element name="name" type="xs:string"/> <xs:element name="salary" type="xs:double" minOccurs="0"/> <xs:element name="department" type="xs:string"/> </xs:sequence> <xs:attribute name="active" type="xs:boolean"/> </xs:complexType> </xs:element> </xs:schema>
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = "title", "author", "price", "publishedDate") @XmlRootElement(name = "book") public class Book @XmlElement(required = true) protected String title; @XmlElement(required = true) protected String author; @XmlElement(required = true) protected BigDecimal price; @XmlSchemaType(name = "date") protected LocalDate publishedDate; @XmlAttribute(name = "id", required = true) protected BigInteger id;
Go to:
: It’s secure (files stay local), free, and allows you to specify target packages and output directories. 3. Integrated Development Environments (IDEs)
xjc -d generated -p com.example.book book.xsd
Below is a review of the "online converter" experience compared to professional alternatives.
<?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="Employee"> <xs:complexType> <xs:sequence> <xs:element name="id" type="xs:int"/> <xs:element name="name" type="xs:string"/> <xs:element name="salary" type="xs:double" minOccurs="0"/> <xs:element name="department" type="xs:string"/> </xs:sequence> <xs:attribute name="active" type="xs:boolean"/> </xs:complexType> </xs:element> </xs:schema>
@XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "", propOrder = "title", "author", "price", "publishedDate") @XmlRootElement(name = "book") public class Book @XmlElement(required = true) protected String title; @XmlElement(required = true) protected String author; @XmlElement(required = true) protected BigDecimal price; @XmlSchemaType(name = "date") protected LocalDate publishedDate; @XmlAttribute(name = "id", required = true) protected BigInteger id;
Go to:
: It’s secure (files stay local), free, and allows you to specify target packages and output directories. 3. Integrated Development Environments (IDEs)