Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / May 2005

Tip: Looking for answers? Try searching our database.

xsd challenge?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Claus Konrad - 23 May 2005 17:58 GMT
Hi

I've got an xml-document (instance document) that contains configurationsettings for my system. Now - I would like to create an xsd-schema to validate this document before I use it in my system.

The strucure of the xmldoc is this:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<securitySection>
<add key="customerLicenseFilePath" value="C:\myprojects\sys\TestLibraryCommon\testConfig\1.xml" />
<add key="cryptography" value="DES" />
</securitySection>
</configuration>

I would like to ensure that the keys are present with "key"-attributes having the values
(e.g. "customerLicenseFilePath" and "cryptography").

How do I specify using XSD that the keys should be present in the instance document based on this schema?

Thanks in advance.
Priya Lakshminarayanan [MSFT] - 23 May 2005 19:31 GMT
If all you want to ensure is that the key and value attributes should be
present, then you can mark them as required attributes in the schema:
Sample schema snippet:
<xs:element name="add">
   <xs:complexType>
       <xs:attribute name="key" type="xs:string" use="required"/>
       <xs:attribute name="value" type="xs:string" use="required"/>
   </xs:complexType>
</xs:element>

Thanks,
Priya

Hi
I've got an xml-document (instance document) that contains
configurationsettings for my system. Now - I would like to create an
xsd-schema to validate this document before I use it in my system.
The strucure of the xmldoc is this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<securitySection>
<add key="customerLicenseFilePath"
value="C:\myprojects\sys\TestLibraryCommon\testConfig\1.xml" />
<add key="cryptography" value="DES" />
</securitySection>
</configuration>
I would like to ensure that the keys are present with "key"-attributes
having the values
(e.g. "customerLicenseFilePath" and "cryptography").
How do I specify using XSD that the keys should be present in the instance
document based on this schema?

Thanks in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.