Attribute name "X" associated with an element type "Y" must be followed by the ' = ' character

StackOverflow https://stackoverflow.com/questions/21804359

  •  12-10-2022
  •  | 
  •  

Question

I am trying to parse an XML file but I keep getting this error when trying to build.

Here is the XML file:

<Student Data>
<Student id="11111">
    <FirstName>Joe</FirstName>
    <LastName>Edwards</LastName>
    <Address>
        <Street>345 North</Street>
        <City>Brea</City>
        <State>CA</State>
        <Zip>99999</Zip>
        <Phone>(714) 444-4444</Phone>
    </Address>
    <Classes>
        <Class crn="5555">
            <Name>CIS 100</Name>
            <Units>3</Units>
            <Grade>A</Grade>
        </Class>
        <Class crn="7777">
            <Name>CIS 111</Name>
            <Units>4</Units>
            <Grade>B</Grade>        
        </Class>
    </Classes>
</Student>
</Student Data>
Was it helpful?

Solution

Your XML seems to be invalid. Tag names can't contains spaces. Try changing

<Student Data> 

to something like

<Student_Data>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top