473,396 Members | 1,933 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

xsd challenge?

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\testCon fig\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.

Nov 12 '05 #1
1 891
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

"Claus Konrad" <no@spam.com> wrote in message
news:uY**************@TK2MSFTNGP15.phx.gbl...
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\testCon fig\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.
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

42
by: Frank Buss | last post by:
I've setup a challenge, mainly for C++, Java and Lisp, but every other language is welcome: http://www.frank-buss.de/challenge/index.html There is nothing to win, but I hope there will be some...
8
by: Frank Buss | last post by:
A new challenge: http://www.frank-buss.de/marsrescue/index.html Have fun! Now you can win real prices. -- Frank Buß, fb@frank-buss.de http://www.frank-buss.de, http://www.it4-systems.de
0
by: Richard Jones | last post by:
The date for the second PyWeek challenge has been set: Sunday 26th March to Sunday 2nd April (00:00UTC to 00:00UTC). The PyWeek challenge invites entrants to write a game in one week from...
0
by: richard | last post by:
The date for the second PyWeek challenge has been set: Sunday 26th March to Sunday 2nd April (00:00UTC to 00:00UTC). The PyWeek challenge invites entrants to write a game in one week from...
11
by: CMM | last post by:
First let me say that maybe I'm having a "duh" moment and perhaps I'm missing something... but it seems to me that no one thing in the System.Collections namespace (even in .NET 2.0) even comes...
78
by: wkehowski | last post by:
The python code below generates a cartesian product subject to any logical combination of wildcard exclusions. For example, suppose I want to generate a cartesian product S^n, n>=3, of that...
2
by: donovan | last post by:
OK, so I know that there has been a lot of discussion on this topic, but none of the answers have been satisfactory. Therefore there seems to be only one thing to do: issue a challenge to all of...
3
by: Thierry | last post by:
For those interested in <b>programming riddles</b>, I would like to announce a new programming challenge I'm just launching at http://software.challenge.googlepages.com This challenge is in its...
0
by: Richard Jones | last post by:
The fifth PyWeek is only a month away. Come along and join the fun: write a video game in a week! There's some really interesting new libraries that have popped up recently. Have a gander on the...
80
by: jacob navia | last post by:
Several people in this group argue that standard C is not portable since there are no compilers for it, etc. I propose this program in Standard C, that I have compiled in several OSes to test if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.