small snippet). i've tried a number of things and can come close, but
i can't quite get it to do what i want. i'm able to validate the
snippet below using .NET with a schema that will make sure that the
six attributes are correct in spelling, but that's about it.
i would like it to be able to:
1) make sure each element(tool) is correct by having all the six
attributes present/required.
2) that each attribute is spelled correctly and consists of a string.
the .xsd is below as well.
i can't find any examples that address the way i have my elements and
attributes structured. i really don't want to have to redo my XML
file to conform to the way my .xsd validates! that just seems silly
and a cop-out to me. am i stubborn you ask? well, yeah!!! :-)
any help is much appreciated. thanks folks...
<?xml version="1.0" encoding="utf-8" ?>
<xs:tools xmlns:xsi="http://www.w3schools.com" xmlns:xs="http://
www.w3schools.com/2001/XMLSchema-instance" xs:schemaLocation="http://
www.w3schools.com tool.xsd">
<tool Name="tool1"
ToolTip="tool1"
ImageUrl="http://blah.com/images/tool1.png"
IsSelected="false"
Text="tool1"
Value="tool1" />
<tool Name="tool2"
ToolTip="tool2"
ImageUrl="http://blah.com/images/tool2.png"
IsSelected="false"
Text="tool2"
Value="tool2" />
</xs:tools >
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" >
<xs:element name="tool" type="toolset" />
<xs:complexType name="toolset">
<xs:attribute name="Name" type="xs:string" use="required"/
><xs:attribute name="ToolTip" type="xs:string"
use="required"/>
<xs:attribute name="ImageUrl" type="xs:string"
use="required"/>
<xs:attribute name="IsSelected" type="xs:string"
use="required"/>
<xs:attribute name="Text" type="xs:string" use="required"/
><xs:attribute name="Value" type="xs:string" use="required"/
></xs:complexType>
</xs:schema>