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

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

  •  12-10-2022
  •  | 
  •  

문제

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>
도움이 되었습니까?

해결책

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

<Student Data> 

to something like

<Student_Data>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top