473,320 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 ?

Jul 27 '06 #1
2 1050
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

ra*******@gmail.com wrote:
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 ?
Jul 28 '06 #2
thanx george....i will do that at the application level itself.
George Bina wrote:
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

ra*******@gmail.com wrote:
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 ?
Jul 28 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Andy Howden | last post by:
I'm trying to define a schema element (allPeriodData) containing up to 50 different decimal child elements (periodData). Each child element (periodData) identifies itself with an ID having a value...
1
by: UndoMiel | last post by:
Hi, I have a situation where i would like to validate the occurance of certain elements, based on the value of an attribute. What is the "best" way to handle such validations? I am fairly new...
8
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link,...
3
by: Pavils Jurjans | last post by:
Hello, I have bumped upon this problem: I do some client-side form processing with JavaScript, and for this I loop over all the forms in the document. In order to identify them, I read their...
3
by: lawrencec | last post by:
Hi there, I'm trying to add the values of a number of form fields and to get a result at the end. It must loop and be able to dynamically update the result of calculation. I have attached the...
8
by: | last post by:
The problem lies here eval("document.TeeForm.amt.value(S+M)"); S and M suppose to add up and the total suppose to appear on the AMT field but it didn't. Any help? ...
3
by: patrizio.trinchini | last post by:
Hi, how can remove sibling elements based on the value of an attribute ? For instance, gven the XML document: <root> <parentElment> <testElement name="A"> <removableElement/>
5
by: patrin | last post by:
Hi All, given the source document: <?xml version="1.0" encoding="UTF-8"?> <root> <child> <test id="1" name="first child"/> </child> <child>
9
by: Tony Girgenti | last post by:
Hello I developed and tested a web application using VS.NET 2003, VB, .NET Framework 1.1.4322, ASP.NET 1.1.4322 and IIS5.1. It uses a web form. I tried doing this without any help, but i'm...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.