Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

XSD Validation based on attribute type value



Hi can any one tell me how to validate xml element value based on attribute value.

Ex:-
my xml has the elements like this.
<channel>
<meta type="VideoTitle">Harding Park Golf Club</meta>
<meta type="ReleaseDate">Wed, 03 Jan 2018 15:00:00 GMT</meta>
</channel>

I want to validate the xml based on meta type value using xsd. For "VideoTitle" i would like check for String type and for ReleaseDate" i want to check for date format.

Thanks,
Raj