Search the web
Sign In
New User? Sign Up
rng-users · RELAX NG users
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Attribute value restrictions   Message List  
Reply | Forward Message #1062 of 1126 |
Re: [rng-users] Attribute value restrictions

Unfortunately that does not help me too much as I have schemas that I import the common attributes into that make use of them more then once , with different restrictions.
What I would really like to be able to do is have some mechanism like xsd complexType that I could then create a restriction on.

So in xml schema I know I can do something like this,  


  <xs:complexType name="codedValueDef">
    <xs:annotation>
      <xs:documentation> Defines that attributes used for coded values </xs:documentation>
    </xs:annotation>
   
    <xs:attribute name="code" use="required"/>
    <xs:attribute name="codeSystem" use="required"/>
    <xs:attribute name="displayName" use="required"/>
  </xs:complexType>


And then use it more then once  like so within the same schema.

<xsd:element name=”value” type="core:codedValueDef">
    
    <xs:complexType >
        <xs:complexContent >
            
            <xs:restriction >
                <xs:attribute name="codeSystem" use="require" fixed="111111"/>
            </xs:restriction>
         </xs:complexContent>
    </xs:complexType>
    
  </xs:element>

<xsd:element name=”value2” type="core:codedValueDef">
    
    <xs:complexType >
        <xs:complexContent >
            
            <xs:restriction >
                <xs:attribute name="codeSystem" use="require" fixed="222222"/>
            </xs:restriction>
         </xs:complexContent>
    </xs:complexType>
    
  </xs:element>

Is there any way to do something similar to this in relax?

Thanks

Rob


On 7/1/09 1:05 AM, "MURATA Makoto (FAMILY Given)" <EB2M-MRT@...> wrote:


  

  

One way to overcome the problem is to use <define> as children of
<include>.

<include href="common.atts.rng>
 <define name="foo">...</define>
 ....
</include>

Here this define statement overrides the define stantement in
common.atts.rng having the name "foo".

Cheers,
Makoto
  
    




Wed Jul 1, 2009 1:49 pm

rob.dingwell
Offline Offline
Send Email Send Email

Forward
Message #1062 of 1126 |
Expand Messages Author Sort by Date

I have a definition that contains a set of attributes that I want to apply to a variety of other types. When applies to the other types I want to be able to...
rob.dingwell
Offline Send Email
Jul 1, 2009
12:07 am

One way to overcome the problem is to use <define> as children of <include>. <include href="common.atts.rng> <define name="foo">...</define> .... </include> ...
MURATA Makoto (FAMILY...
mktmurata
Offline Send Email
Jul 1, 2009
5:07 am

Unfortunately that does not help me too much as I have schemas that I import the common attributes into that make use of them more then once , with different...
Dingwell, Robert A.
rob.dingwell
Offline Send Email
Jul 1, 2009
1:49 pm

... I am not an expert of W3C XML Schema, but I have thought that you have to copy the content of the original and then modify it rather than describing...
MURATA Makoto (FAMILY...
mktmurata
Offline Send Email
Jul 8, 2009
3:21 pm

On 7/8/09 11:18 AM, "MURATA Makoto (FAMILY Given)" ... You can just describe the differences on a restriction and on an extension you just add whatever else...
Dingwell, Robert A.
rob.dingwell
Offline Send Email
Jul 8, 2009
3:41 pm

... I was a member of the W3C XML Schema WG. As far as derivation by restriction is concerned, I strongly believe that you have to write everything rather...
MURATA Makoto (FAMILY...
mktmurata
Offline Send Email
Jul 8, 2009
4:32 pm

On 7/8/09 12:30 PM, "MURATA Makoto (FAMILY Given)" ... The example was completely off the top of my head not really trying to validate. While it is true that...
Dingwell, Robert A.
rob.dingwell
Offline Send Email
Jul 8, 2009
6:38 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help