473,385 Members | 2,004 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,385 software developers and data experts.

Unique constraints not working - please help

pr
I have the following sample XML File:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<parent>
<child ref="1"><grandchild>tom</grandchild></child>
<child ref="1"><grandchild>harry</grandchild></child>
</parent>

And the schema is:

<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" >
<xsd:simpleType name = "oneormore">
<xsd:restriction base="xsd:integer">
<xsd:minInclusive value="1"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="parent">
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<!-- A chart consists of several rows -->
<xsd:element name="child">
<xsd:complexType>
<xsd:sequence minOccurs="1" maxOccurs="unbounded">
<xsd:element name="grandchild" type = "xsd:string"/>
</xsd:sequence>
<xsd:attribute name="ref" type="xsd:integer" use="required"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<!-- This is not working -->
<xsd:unique name="rowID">
<xsd:selector xpath="parent/child"/>
<xsd:field xpath="@ref"/>
</xsd:unique>
</xsd:element>
</xsd:schema>

The problem is that my XML file validates successfully in my Java
(DOM) app, despite the fact that the values of the ref attributes in
the child element are NOT unique (we have two occurrences of "1").

Is this a bug in the parser, or have I done something wrong in my
schema?
Mar 13 '08 #1
0 1414

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

Similar topics

2
by: Mansoor Azam | last post by:
When I add a unique key constraint to column in SQL 6.5 why does it also create an index. e.g. In the table subaccounts I added a unique key constraint for the column login and SQL creates an index...
5
by: Kamil | last post by:
Hello What should I use for better perfomance since unique constraint always use index ? Thanks Kamil
4
by: Joăo Santa Bárbara | last post by:
Hi all i have a problem with my sql dataadapter, i think. i have this table below ( Script ) and this table has one particularity, it has 2 unique constraints. when i´m filling my datatable...
8
by: Paul Reddin | last post by:
Hi, We have been having many issues with unique constraints and we seem to have boiled it down to the equivalent of the following very simple scenario... given a table with a unqiue...
10
by: BuddhaBuddy | last post by:
Platform is DB2/NT 7.2.9 The table was created like this: CREATE TABLE MYTEST ( MYTESTOID bigint not null primary key, FK_OTHEROID bigint not null references other, FK_ANOTHEROID bigint not...
7
by: Brian Keating | last post by:
Hi there, Is it possible to add a unique constraint on two columns in a table, so that the constraint is a composite of the two? i.e. these two columns together should be unique...? i.e....
10
by: Phil Latio | last post by:
I am inserting data into user table which contains 5 fields, sounds simple enough normally but 2 of the fields are designated as UNIQUE. If someone does enter a value which already exists, how do I...
1
by: holdingbe | last post by:
Hi all, I created one table with only one primary constraints.when i inserted data into that table.It shows the unique constraints errors.after i check any duplicate data present in the...
4
by: Bobby Edward | last post by:
I have an xsd dataset. I created a simple query called GetDataByUserId. I can preview the data fine! I created a very simple BLL function that calls it and returns a datatable. When I run...
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: 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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.