Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Restricting Attributes in Attributegroup

From: Mahalax@-----------.---------.---
To: NULL
Date: 10/31/2004 11:29:00 PM
Here is the link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xsdrefattributeelement.asp

"Han" wrote:

> Interesting example. As I read MSDN, only the name of a complexType is 
> allowed.
> 
> (Excerpt)
> 
> restriction (complexContent)
> 
> base
> The name of a complexType element defined in this schema (or another schema 
> indicated by the specified namespace). The element containing the 
> restriction element is derived from the type specified by the base value.
> 
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/xsdrefrestrictioncomplexContentElement.asp
> 
> Do you happened to have a link of the example?
> 
> "Mahalax" <Mahalax@d...> wrote in message 
> news:796D6E29-A336-48B7-92B9-CA8C6F73F8CD@m......
> > Yes, it does. Here is the MSDN sample.
> >
> > <xs:attributeGroup name="A">
> >  <xs:attribute name="x" type="xs:NCName"/>
> >  <xs:attribute name="y" type="xs:QName"/>
> > </xs:attributeGroup>
> >
> > <xs:complexType name="B">
> >  <xs:complexContent>
> >   <xs:restriction base="xs:A">
> >    <xs:attribute name="x" use="required" />
> >    <xs:attribute name="y" use="prohibited"/>
> >   </xs:restriction>
> >  </xs:complexContent>
> > </xs:complexType>
> >
> > -Maha
> >
> > "Han" wrote:
> >
> >> I mean reuse. I mean @use attribute at reused attributeGroup.
> >> By the way, does MSDN example use name of an attributeGroup for its @base
> >> attribute?
> >>
> >> "Mahalax" <Mahalax@d...> wrote in message
> >> news:CE54F817-01C7-487C-B277-F8245F2E0531@m......
> >> > Hi Han,
> >> >
> >> > Actually I am trying to explore the attributegroup and its purpose. 
> >> > Many
> >> > of
> >> > my schemas have a set of common atributes which I am trying to declare
> >> > commonly and reuse as required. The code I have posted is an adaptation
> >> > from
> >> > MSDN which is not working.
> >> >
> >> > "Han" wrote:
> >> >
> >> >> OOPS, I mean @use by @required in the earlier post. Values are,
> >> >>
> >> >> optional, prohibited, required
> >> >>
> >> >> "Mahalax" <Mahalax@d...> wrote in message
> >> >> news:207B477E-4686-4015-8CFE-A510B3AEBE6B@m......
> >> >> > Greetings.
> >> >> >
> >> >> > Below is the schema snippet I am trying to explore attributegroups 
> >> >> > and
> >> >> > attribute's use property. However I am getting a validation error
> >> >> > saying
> >> >> > "undefined value for base encountered", pointing to 
> >> >> > <xs:restriction>.
> >> >> > Please
> >> >> > help.
> >> >> >
> >> >> > <?xml version="1.0" encoding="UTF-8"?>
> >> >> > <xs:schema elementFormDefault="qualified"
> >> >> > attributeFormDefault="unqualified"
> >> >> > xmlns:xs="http://www.w3.org/2001/XMLSchema">
> >> >> > <xs:attributeGroup name="grp">
> >> >> > <xs:attribute name="x" type="xs:string"/>
> >> >> > <xs:attribute name="y" type="xs:string"/>
> >> >> > <xs:attribute name="z" type="xs:string"/>
> >> >> > </xs:attributeGroup>
> >> >> > <xs:complexType name="A">
> >> >> > <xs:complexContent>
> >> >> > <xs:restriction base="xs:grp">
> >> >> > <xs:attribute name="x" use="required"/>
> >> >> > <xs:attribute name="y" use="prohibited"/>
> >> >> > <xs:attribute name="z" use="required"/>
> >> >> > </xs:restriction>
> >> >> > </xs:complexContent>
> >> >> > </xs:complexType>
> >> >> > </xs:schema>
> >> >> >
> >> >> > Best Regards,
> >> >> > Mahalakshmi Natarajan
> >> >> > http://mahalax.blogspot.com
> >> >> > http://dotnetjunkies.com/weblog/mahalax
> >> >>
> >> >>
> >>
> >> 
> 
> 


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent