java - How to get error line number when validation xml -


i have xml this:

<a>    <b>some content</b>    <c>some content</c>    <d>        <d1>some content</d1>        <d2>some content</d2>    </d> </a> 

i want validate xml file, must conform xml format above, say: element "b", "c", "d" can child of element "a", , element "d1" , "d2" can child of element "d", , content of "b" can characters. if xml file failed conform these rules, program report error lines numbers, not first error line number. , jdk 5. how validate this?

use xml schema define rules , use validator in javax.xml.validation validate it.have here.


Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -