title: StAX Parser Content is not allowed in prolog
body: <p>It's my hometask. I don't understand what it want from me and why it doesn't work. It fails on the reader.next() . The path is right. Here's the code on Java of StAXParser:</p>
  
  <pre><code>public class StAXParser {
  
  private Dances dances;
  private Dance currentDance;
  private Dancer currentDancer;
  
  public static void main(String[] args) {
      StAXParser stAXParser = new StAXParser();
      stAXParser.parse("DanceGroupConcerts.xml");
  }
  
  public Dances getDances() {
      return dances;
  }
  
  public StAXParser() {
  }
  
  public void parse (String xmlFileName){
      try {
          XMLStreamReader reader = XMLInputFactory.newInstance().createXMLStreamReader(new StringReader(xmlFileName));
          int tag;
          String tagName;
          String text = new String();
          while (reader.hasNext()){
              tag = reader.next();
  
              switch (tag){
                  case XMLStreamReader.START_ELEMENT:
  
                      tagName = reader.getLocalName();
  
                      if (tagName == "Dances")
                          dances = new Dances();
                      if (tagName.equals("Dance"))
                          currentDance = new Dance();
                      if (tagName.equals("Dancer"))
                          currentDancer = new Dancer();
                      break;
  
                  case XMLStreamReader.CHARACTERS:
                      text = reader.getText();
                      break;
  
                  case XMLStreamReader.END_ELEMENT:
  
                      tagName = reader.getLocalName();
  
                      if (tagName.equals("Dancer"))
                          currentDance.getDancers().add(currentDancer);
                      if (tagName.equals("Dance"))
                          dances.getDance().add(currentDance);
                      if (tagName.equals("Type"))
                          currentDance.setType(text);
                      if (tagName.equals("Scene"))
                          currentDance.setScene(text);
                      if (tagName.equals("NumberOfDancers"))
                          currentDance.setNumberOfDancers(NumberOfDancers.fromValue(text));
                      if (tagName.equals("Music"))
                          currentDance.setMusic(Music.fromValue(text));
                      if (tagName.equals("Name"))
                          currentDancer.setName(text);
                      if (tagName.equals("DanceTeam"))
                          currentDancer.setNameOfDanceTeam(text);
                      if (tagName.equals("Age"))
                          currentDancer.setAge(BigInteger.valueOf(Integer.valueOf(text)));
                      if (tagName.equals("Experience"))
                          currentDancer.setExperience(BigInteger.valueOf(Integer.valueOf(text)));
                      if (tagName.equals("Number"))
                          currentDance.setNumber(BigInteger.valueOf(Integer.valueOf(text)));
  
                      break;
              }
  
  
          }
  
      } catch (XMLStreamException e) {
          e.printStackTrace();
      }
  }
  </code></pre>
  
  <p>}</p>
  
  <p>And XSD:</p>
  
  <pre><code>    &lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;schema xmlns="http://www.w3.org/2001/XMLSchema"
  xmlns:Dance="Dancers"
  targetNamespace="Dancers"&gt;
    &lt;simpleType name="Type"&gt;
      &lt;restriction base="string"&gt;&lt;/restriction&gt;
    &lt;/simpleType&gt;
  
    &lt;simpleType name="Scene"&gt;
      &lt;restriction base="string"&gt;&lt;/restriction&gt;
    &lt;/simpleType&gt;
  
    &lt;simpleType name="NumberOfDancers"&gt;
      &lt;restriction base="string"&gt;
        &lt;enumeration value="mass"&gt;&lt;/enumeration&gt;
        &lt;enumeration value="solo"&gt;&lt;/enumeration&gt;
        &lt;enumeration value="pair"&gt;&lt;/enumeration&gt;
      &lt;/restriction&gt;
    &lt;/simpleType&gt;
  
    &lt;simpleType name="Music"&gt;
      &lt;restriction base="string"&gt;
        &lt;enumeration value="phonogram"&gt;&lt;/enumeration&gt;
        &lt;enumeration value="alive"&gt;&lt;/enumeration&gt;
      &lt;/restriction&gt;
    &lt;/simpleType&gt;
  
    &lt;simpleType name="Number"&gt;
      &lt;restriction base="integer"&gt;&lt;/restriction&gt;
    &lt;/simpleType&gt;
  
      &lt;simpleType name="Name"&gt;
      &lt;restriction base="string"&gt;&lt;/restriction&gt;
    &lt;/simpleType&gt;
  
    &lt;simpleType name="DanceTeam"&gt;
      &lt;restriction base="string"&gt;&lt;/restriction&gt;
    &lt;/simpleType&gt;
  
    &lt;simpleType name="Age"&gt;
      &lt;restriction base="integer"&gt;&lt;/restriction&gt;
    &lt;/simpleType&gt;
  
    &lt;simpleType name="Experience"&gt;
      &lt;restriction base="integer"&gt;&lt;/restriction&gt;
    &lt;/simpleType&gt;
  
  
    &lt;complexType name="Dancer"&gt;
      &lt;sequence&gt;
        &lt;choice&gt;
          &lt;element name="name" type="Dance:Name"&gt;&lt;/element&gt;
          &lt;element name="nameOfDanceTeam" type="Dance:DanceTeam"&gt;&lt;/element&gt;
        &lt;/choice&gt;
        &lt;element name="age" type="Dance:Age"&gt;&lt;/element&gt;
        &lt;element name="experience" type="Dance:Experience"&gt;&lt;/element&gt;
      &lt;/sequence&gt;
    &lt;/complexType&gt;
  
      &lt;complexType name = "Dance"&gt;
       &lt;sequence&gt;
         &lt;element name="type" type="Dance:Type"&gt;&lt;/element&gt;
         &lt;element name="scene" type="Dance:Scene"&gt;&lt;/element&gt;
         &lt;element name="numberOfDancers" type="Dance:NumberOfDancers"&gt;&lt;/element&gt;
         &lt;element name="music" type="Dance:Music"&gt;&lt;/element&gt;
         &lt;element name="dancers" type="Dance:Dancer" minOccurs="1" maxOccurs="unbounded"&gt;&lt;/element&gt;
         &lt;element name="number" type="Dance:Number"&gt;&lt;/element&gt;
       &lt;/sequence&gt;
      &lt;/complexType&gt;
  
  
    &lt;element name="Dances"&gt;
      &lt;complexType&gt;
          &lt;sequence&gt;
              &lt;element name="Dance" type="Dance:Dance" minOccurs="1" maxOccurs="unbounded"&gt;&lt;/element&gt;
          &lt;/sequence&gt;
      &lt;/complexType&gt;
    &lt;/element&gt;
  &lt;/schema&gt;
  </code></pre>
  
  <p>And XML:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Dances&gt;
  &lt;Dance&gt;
      &lt;Type&gt;Folk&lt;/Type&gt;
  
      &lt;Scene&gt;Dr. Frank N. Furter Major&lt;/Scene&gt;
  
      &lt;NumberOfDancers&gt;mass&lt;/NumberOfDancers&gt;
  
      &lt;Music&gt;phonogram&lt;/Music&gt;
  
      &lt;Dancer&gt;
          &lt;Name&gt;Majenta&lt;/Name&gt;
          &lt;Age&gt;25&lt;/Age&gt;
          &lt;Experience&gt;25&lt;/Experience&gt;
      &lt;/Dancer&gt;
  
      &lt;Dancer&gt;
          &lt;Name&gt;Riff Raff&lt;/Name&gt;
          &lt;Age&gt;2500&lt;/Age&gt;
          &lt;Experience&gt;25&lt;/Experience&gt;
      &lt;/Dancer&gt;
  
      &lt;Dancer&gt;
          &lt;Name&gt;Columbia&lt;/Name&gt;
          &lt;Age&gt;25&lt;/Age&gt;
          &lt;Experience&gt;25&lt;/Experience&gt;
      &lt;/Dancer&gt;
  
      &lt;Dancer&gt;
          &lt;DanceTeam&gt;Guests&lt;/DanceTeam&gt;
          &lt;Age&gt;2566&lt;/Age&gt;
          &lt;Experience&gt;667&lt;/Experience&gt;
      &lt;/Dancer&gt;
  
      &lt;Number&gt;1&lt;/Number&gt;
  &lt;/Dance&gt;
  &lt;/Dances&gt;
  </code></pre>
  
  <p>Thank's for help. Sorry if my english was too bad.</p>