Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old July 27th, 2006, 04:25 PM
raulverde@gmail.com
Guest
 
Posts: n/a
Default XSD problem , need an attribute which contains the number of child elements

I have an element declared like this :

<xs:element name="class">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="className" minOccurs="0" />
<xs:element name="students" type="student" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>

Now i need an attirbute in "students" ... lets call it "totalStudents"
which would contain the number of students...is it possible ?

  #2  
Old July 28th, 2006, 08:15 AM
George Bina
Guest
 
Posts: n/a
Default Re: XSD problem , need an attribute which contains the number of child elements

Hi,

You can add an attribute and specify the total number of students there
but XML Schema does not have a way to check that the value of that
attribute represents the number of students. You can check that either
at application level or using Schematron embedded in XML Schema.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com

raulverde@gmail.com wrote:
Quote:
I have an element declared like this :
>
<xs:element name="class">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="className" minOccurs="0" />
<xs:element name="students" type="student" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
>
Now i need an attirbute in "students" ... lets call it "totalStudents"
which would contain the number of students...is it possible ?
  #3  
Old July 28th, 2006, 03:15 PM
raulverde@gmail.com
Guest
 
Posts: n/a
Default Re: XSD problem , need an attribute which contains the number of child elements

thanx george....i will do that at the application level itself.


George Bina wrote:
Quote:
Hi,
>
You can add an attribute and specify the total number of students there
but XML Schema does not have a way to check that the value of that
attribute represents the number of students. You can check that either
at application level or using Schematron embedded in XML Schema.
>
Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
>
raulverde@gmail.com wrote:
Quote:
I have an element declared like this :

<xs:element name="class">
<xs:complexType>
<xs:sequence>
<xs:element name="name" type="className" minOccurs="0" />
<xs:element name="students" type="student" minOccurs="0"
maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>

Now i need an attirbute in "students" ... lets call it "totalStudents"
which would contain the number of students...is it possible ?
 

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles