W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2001

A XPath expresion

From: Joan Pujol <joan.pujol@ima.udg.es>
Date: Tue, 30 Oct 2001 17:29:40 +0100
Message-ID: <3BDED574.E67CB770@ima.udg.es>
To: xmlschema-dev@w3.org
Hi,

I need a XPath for Selector that selects:
*|Group|Group/Group|Group/Group/Group|... etc.

Can I write it with the Xpath Subset for Schemas?

I explain my problem because if it ins't possible maybe there is a workarround
or another way to solution the problem.


I write a Schema for a Generic Structured model of data:
Basically I have two elements: Struct and Scalar. (I have more but, it isn't
important for the problem...)

Each Struct or Scalar is identified with a name attribute. The name must be
unique in his 'namespace'.
Struct contains Scalars, and provides a diferent namespace for the scalars that
contains.
Structs can be nested.

I write a Schema for this, and I have no problem to set the Identity
constraints.
The problem starts when I introduce another element: Group.
Group is like Struct but it is neutral for validation, it is only used to group
elements and set common attributes for visualitzation, etc...
In another words, Group don't provide a namespace for the elements that
contains.

That's because I need the Xpath expresion of the begining.

I put an exemple because my english is poor, and I can't explain better.


This break my rules, because Group don't provide a namespace and there are two
elements with the same name:
<Struct name='Film'>
	<Scalar name='Title'>
	<Group name='Group1'>
		<Scalar name='Title'>
	</Group>
</Struct>
	
but this don't:
Because the struct provides another 'namespace' for his children elements.
<Struct name='Film'>
	<Scalar name='Title'>
	<Struct name='Struct1'>
		<Scalar name='Title'>
	</Struct>
</Struct>

Can I expresse it with Schema Identity Constraints?


Bye,


-- 
---
Joan Jesús Pujol Espinar
PTS Sistemes Departament IMA
Received on Tuesday, 30 October 2001 11:30:05 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:24 GMT