473,698 Members | 2,047 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="unbo unded" />
</xs:sequence>
</xs:complexType>
</xs:element>

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

Jul 27 '06 #1
2 1064
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="unbo unded" />
</xs:sequence>
</xs:complexType>
</xs:element>

Now i need an attirbute in "students" ... lets call it "totalStude nts"
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="unbo unded" />
</xs:sequence>
</xs:complexType>
</xs:element>

Now i need an attirbute in "students" ... lets call it "totalStude nts"
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
1548
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 from 1 to 50. Each child element is optional (i.e. there don't have to be 50 altogether) but each ID (1-50) may occur only once within the parent element. The best definition I have so far is this: <xs:element name="allPeriodData">...
1
1504
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 to XML and its validation techniques. Schematron would probably do the trick, but i havent found a straight forward way that solves my problem. Anybody ideas - recommendations?
8
4227
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, which when you click it bookmarks the site (much easier). The favicon is never saved if the site is bookmarked this way. Does anyone have any ideas how to fix this?? This is the code: <script language="JavaScript">
3
2700
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 "name" property (which sources from "name" HTML attribue). The problem is, that if the form contains form control named "name", it overwrites the form name property. In fact, I'm quite surprised that it's so easy to spoil any of the form object...
3
2408
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 code i have so far. Thanks <html> <head>
8
3712
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? ============================ CODE ==============================================
3
2746
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
1801
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
1607
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 getting nowhere. I want to create an XML schema (XSD) for a dataset/datatable using the XML designer.
0
8674
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8861
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7723
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6518
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4366
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3045
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.