Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>The correct scheme should be: </p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.example.org/Sport" xmlns:tns="http://www.example.org/Sport" elementFormDefault="qualified" xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="2.0"&gt; &lt;complexType name="sportType"&gt; &lt;simpleContent&gt; &lt;extension base="string"&gt; &lt;attribute name="type" type="string" /&gt; &lt;attribute name="gender" type="string" /&gt; &lt;/extension&gt; &lt;/simpleContent&gt; &lt;/complexType&gt; &lt;element name="sports"&gt; &lt;complexType&gt; &lt;sequence&gt; &lt;element name="sport" minOccurs="0" maxOccurs="unbounded" type="tns:sportType" /&gt; &lt;/sequence&gt; &lt;/complexType&gt; &lt;/element&gt; </code></pre> <p>Code generated for SportType will be:</p> <pre><code>package org.example.sport; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlType; @XmlAccessorType(XmlAccessType.FIELD) @XmlType(name = "sportType") public class SportType { @XmlValue protected String value; @XmlAttribute protected String type; @XmlAttribute protected String gender; public String getValue() { return value; } public void setValue(String value) { this.value = value; } public String getType() { return type; } public void setType(String value) { this.type = value; } public String getGender() { return gender; } public void setGender(String value) { this.gender = value; } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload