473,387 Members | 1,904 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,387 software developers and data experts.

XML Schema Checking

Hi all,

I need you all help me to solve my problem here. The problem im facing now is I have 2 tag to fill in which is

<Specialization></Specialization>
<JobRole></JobRole>

JobRole's data are inserted base on the value insert in Specialization. For example :

Specialization : IT/Computer Science
Job Role : Programmer, Network Administrator, Developer, etc
Specialization : Secretary
Job Role : Secretary

Job Role "Secretary" can only be fill in if only specializaton "Secretary" are inserted. How can i do this in XML schema?

Your help is needed! Thanks
Sep 23 '08 #1
4 1714
MarkoKlacar
296 Expert 100+
Hi,

Is your schema XSD or DTD?

/MK
Sep 23 '08 #2
Dormilich
8,658 Expert Mod 8TB
XSD when I understand it right.
Sep 23 '08 #3
jkmyoung
2,057 Expert 2GB
So in other words, you can have
1.
<Specialization></Specialization>
<JobRole></JobRole>

2. <Specialization>Secretary</Specialization>
<JobRole></JobRole>

3. <Specialization>Secretary</Specialization>
<JobRole>Secretary</JobRole>

but this is not allowed?
4. <Specialization></Specialization>
<JobRole>Secretary</JobRole>

What you're trying to do is called cooccurrence constraints. You could validate it if you were using extensions, such as schematron http://en.wikipedia.org/wiki/Schematron. The functionality to check what you're doing is not within xml schema, unless you're using key/index constraints, which it doesn't look like you are from your IT example.
Sep 23 '08 #4
Hi,

My schema is XSD format.

And here is my scenario

Correct:
<Specialization>IT/Computer Science</Specialization>
<JobRole>Programmer</JobRole>

Wrong:
<Specialization>IT/Computer Science</Specialization>
<JobRole>Secretary</JobRole>

where the specialization and job role is a mandatory field

Thanks for the help!
Sep 24 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Siddhartha Singh | last post by:
Hi, If XML can be validated by either DTD or Schema and Schema itself is a XML. How can we validate a Schema ? Cheers, Siddhartha Singh singh_siddhu@yahoo.com
5
by: Zombie | last post by:
Hi, Can I have 2 namespaces in the same XML schema? In the schema, I wish to declare elements such that some of them belong to one namespace and others belong to a second namespace. Is this...
4
by: joes | last post by:
Hello there I tried for several days to get a simple validation with xml schema & xerces working. Goal for me is tuse JAXP and not specific Xerces classes. I don't get the point what I am doing...
2
by: simon ames | last post by:
I have an XML file i'd like to validate against an XSD schema. I'm creating the XML on the fly in an ASP.NET page and need to validate it aginst the schema to ensure its well formed. How do i...
2
by: George W. | last post by:
Can someone help me with this? I keep double checking my schema layout and it looks like my implementation is correct... yet it must not be. I have the following schema which is invalid (Says:...
0
by: Harold Putman | last post by:
The XmlValidatingReader seems to have changed drastically in .Net Frameworks 1.0 SP3 and beyond with regards to validating XML files that are XML Schemas. Consider the following code: ---...
3
by: Chris Lieb | last post by:
I am new to XML Schema and am running into a bit of a snag. I have defined an XML-based scripting language for an updater program that I am working on. I would like to make a schema for this...
4
by: Stan R. | last post by:
Hello, I have xmllint and xsltproc installed and running on both my linux and win32 platforms, all seems good. I have a couple questions though. 1) If I have an external dtd file, which is...
3
by: kkao77 | last post by:
I am trying to use schema to validate the data that user sent to my service. How do I achieve that using schema? Do I give schema to the client? or do I write my own schema validation inside web...
1
by: brucepickford001 | last post by:
Hi, I have a not simple problem. I want the following XML to be schema valid <PopulationDemographic> <PersonName>Joe Blogs</PersonName> <Age>2</Age> <Category>baby</Category>...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.