2014-04-30 7 views
0

얘들 아 내가 너무 솔루션을 찾을 수 없습니다 이상한 XML 오류, 당신의 오류를 볼 수 있습니다지고있어 잘 형성되지?XML 구문 분석 오류 :

편집 : 나는이 프로젝트는 기본 HTML5 패턴을 속성을 사용하여 입력을 검증하는 형태이며, 상대적 코드를 추가 한 등

XML Parsing Error: not well-formed 
Location: file:///C:/Users/Michael/Desktop/assignment/customer.xml 
Line Number 47, Column 81:  <input type="text" id="firstname" maxlength="20" pattern="[A-Za-z]+" required /> 
       ----------------------------------------------------------------------------------------------^ 

    <!DOCTYPE HTML> 
    <html lang="en"> 
    <head> 
    <meta charset="utf-8" /> 
    <meta name="description" 
    content="This document is about a Pizza meal being offered at a restaurant " /> 
    <meta name="keywords" content=" 
    Assignment1 5570891 Restaurant Meal" /> 
    <meta name="author" content="[Michael Freeman]" /> 
    <link href= "styles/Styles.css" rel="stylesheet" type="text/css" /> 
    <!--<script src="jquery.js"></script> 
    <script type="text/javascript" src="alternative.js"></script>--> 

    <script type="text/javascript" src="product.js"></script> 
    <title> Michael's Pizza Assignment </title> 
    </head> 
    <body> 
    <!-- Contains the header information that sits on top of the page--> 
     <header> 
     <h1> 
     Order Online 
     </h1> 
     </header> 
    <!-- The navigation bar and "current" class which is used in the CSS-->  
      <nav><a href="index.html" >Title</a>|<a href="product1.html">Pizza</a>|<a href="about.html " >About Me</a>|<a href="Enhancements.html">Extras</a> 
      </nav>  
    <!-- Contains the information in the top bar of the page, this bar maintains its appearance throughout all pages and informs the user of the purpose of the page-->  
     <nav class="orderbar"><p> 
      <a href="customer.html" class="current">Register</a>|<a href="select.html" >Make your order</a>|<a href="purchase.html">Complete payment</a> 
      </p> 
      </nav> 

    <!-- Contains the information in the second bar of the page, this bar maintains its appearance throughout all pages-->   
      <article class="secondbar"> 
      <h3>Please fill out the following form to register 
      </h3> 

      </article> 


      <section> 

      <form id="registerform" method="post" action="http://mercury.ict.swin.edu.au/it000000/formtest.php"> 
      <fieldset id="person"> 
      <legend>Customer registration</legend> 
      <p><label for="firstname">First Name:</label> 
      <input type="text" name="name" id="firstname" maxlength="20" pattern="[A-Za-z]+" required /> 
      </p> 
      <p><label for="surname">Surname:</label> 
      <input type="text" name="surname" id="surname" maxlength="20" pattern="[A-Za-z]+" required /> 
      </p> 
      <p><label for="age">Date of birth:</label> 
      <input type="text" name="age" id="age" required pattern="(0[1-9]|[12][0-9]|3[01])[- /.](0[1-9]|1[012])[- /.](19|20)\d\d" placeholder="DD/MM/YYYY" /> 
      </p> 
      <p><label for="email">Email:</label> 
      <input type="email" name="email" id="email" placeholder="[email protected]" required/> 
      </p> 
      <p><label for="phonenumber">Phone number:</label> 
      <input type="tel" name="phonenumber" id="phonenumber" maxlength="10" placeholder="Mobile number:04xxxxxxxx"   required/> 
      </p> 
      </fieldset> 
      <fieldset> 
      <legend>Address details</legend> 
      <p><label for="address">Residential address</label> 
      <input type="text" name="raddress" id="raddress" maxlength="40" requried/> 
      </p> 
      <p><label for="suburb">Suburb/Town</label> 
      <input type="text" name="suburb" id="suburb" maxlength="20" required/> 
      </p> 
      <p><label for="state">State</label> 
      <select name="state" id="state" required> 
      <option value="Vic" selected="selected">Vic</option> 
      <option value="NSW">Nsw</option> 
      <option value="QLD">Qld</option> 
      <option value="SA">SA</option> 
      <option value="WA">WA</option> 
      <option value="NT">NT</option> 
      <option value="ACT">ACT</option> 
      </select></p> 
      <p><label for="postcode">Postcode</label> 
      <input type="text" name="postcode" id="postcode" pattern="[0-9]{4}" maxlength="4" required/> 
      </p> 




      <p><label>Delivery Address</label> 
      <input type="text" name="daddress" id="daddress" maxlength="40"/></p> 
      <p><label>The same as residential address:</label> 
      <input type="checkbox" name="checkaddress" id="checkaddress" /> 
      </p> 

      </fieldset> 
      <p><input type="submit" value="Register" id="submit" /> 
      <input type="reset" value="Reset" /> 


      </form> 
      </section> 

    <!-- The footer which contains a link that allows users to email the author of the page-->   
    <footer><p>Email</p> <a href="mailto:[email protected]" >Michael Freeman</a> 
    </footer> 
    </body> 
    </html> 
+1

XML에 "빈"속성이 없습니다. - 필수 항목은 유효하지 않습니다. 형식은'attributename = "value"'이어야합니다. 빈 HTML 속성을 XHTML로 변환하는 협약은 속성 이름을 값'required = "required"'로 반복합니다. – CBroe

+0

고마워 이것이 내 문제를 해결했습니다! 웬일인지 나는 대답으로서 당신의 설명을 선택할 수 없다. – Kaleon

+0

그것은 단지 주석 이었기 때문입니다 :-) 지금 답변으로 추가되었습니다. – CBroe

답변

3

더는 "빈은"XML 속성이 없습니다 - required가 유효하지, 그것을 형태는 attributename="value"이어야합니다. XHTML 가치, required="required" 같은 속성 이름을 반복되는 빈 HTML로 변환하는

협약은 속성.