[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XSD atribute repeated

Subject: Re: XSD atribute repeated
From: "Andrew Welch" <andrew.j.welch@xxxxxxxxx>
Date: Fri, 30 May 2008 10:36:02 +0100
Re:  XSD atribute repeated
2008/5/30 IZASKUN GUTIERREZ GUTIERREZ <igutierrez027@xxxxxxxxxxxxx>:
> <?xml version="1.0" encoding="windows-1252"?>
> <file xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>  xsi:schemaLocation="http://bibtexml.sf.net/ esquema_mas_completo.xsd"
>  xmlns="http://bibtexml.sf.net/">
>
>  <entry id="abc">
>    <article>
>      <author>Menindez, Isabel</author>
>      <title>Actuar con prudencia</title>
>     </article>
>  </entry>
>
>  <entry id="abc">
>    <book>
>      <author>Boyne, John</author>
>      <year>2006</year>
>     </book>
>  </entry>
>
> </file>

>  I need that the XSD file not validate the XML file if in the XML appears
> for example two atributes that have the same value. In the example of xml,
> the atribute id is the same in both of entry (abc).
>
> There is some way for not validate it?

This is probably off-topic for xsl-list - for XML Schema specific
questions use the xmlschema-dev mailing list.

To check for uniqueness, use xs:unique :) If you added the following
to the definition for <file> it would do what you need:

<xs:unique name="id">
  <xs:selector xpath="entry"/>
  <xs:field xpath="@id"/>
</xs:unique>

Alternatively just type the id attribute as xs:ID, as long as your ids
are all valid ids.



--
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.