473,785 Members | 2,234 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to define a key which generates unique sequence number?



hi,
i would like to define a unique key in the XSD, and once generating a
default XML out of it (using XSD2INST tool), the XML will automaticaly
be populated with a unique sequence number.

similar to defining a sequence number in DB.

can anyone advise how to do that?

thanks :-)
*** Sent via Developersdex http://www.developersdex.com ***
Oct 3 '08 #1
2 2398
XML fellow wrote:
i would like to define a unique key in the XSD, and once generating a
default XML out of it (using XSD2INST tool), the XML will automaticaly
be populated with a unique sequence number.

similar to defining a sequence number in DB.

can anyone advise how to do that?
A key is defined with the xs:key element and its child elements
xs:selector and xs:field, see
http://www.w3.org/TR/xmlschema-0/#sp...ysAndtheirRefs

Whether that tool you mention is then able to generate keys I don't
know. You might want to check its documentation or find out whether
there is a support forum or mailing list.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Oct 3 '08 #2


thanks :-)
I'm familiar with the Key/Key-ref items.
my question relates more to the 'sequence' issue. when you define
selector it relates to some pre-defined key. i need this key to be a
sequence, i.e. i++ each time it's being used.

*** Sent via Developersdex http://www.developersdex.com ***
Oct 3 '08 #3

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

Similar topics

7
2398
by: Tony Clarke | last post by:
Hi, I'm trying to write a system thats used for about 50 clients that uses html forms and php to log details. The problem is that when a client loads the form page it's given a value which is the last record in a table +1 (i.e. so its the next record). The problem with that is that a client could sit on that page for 20 mins (or whatever length of time) and a different client could use that record number and there what be an error...
7
7663
by: hyppos | last post by:
Hi, I've a XML Schema with this user Type <xsd:simpleType name="ResultArrayType"> <xsd:restriction base="xsd:nonNegativeInteger"> <xsd:maxExclusive value="1000"/> </xsd:restriction> </xsd:simpleType> How can I add an unique costraint to this type?
5
1747
by: mhuhn.de | last post by:
I am using XML Schema for quite a while but haven't written a single line of Relax NG yet. For what I know, I cannot define static content within an XML Schema. For example, I have the following structure: <colors> <color>green</color> <color>red</color> </colors>
2
6904
by: joewhitehair | last post by:
Using the XSD.exe tool, I created a number of classes from my XSD file. When I generate the WSDL for my web service, the schema does not have the proper Occurance constraints for the attributes. In this example, the MessageID element should always occur (minOccur=1, maxOccur=1), but the WSDL generates minOccur=0. I can't pinpoint why this is happening and I can't find a may to force this in the code either. Anyone have any insight? This...
8
2125
by: Abhishek | last post by:
Hi! I need to create a unique password everytime i click a button . what technique/Algo should i follow. Abhishek
2
4033
by: pstachy | last post by:
Hi again! I have another issue. I would like the attribute of the tag <invoice> to be unique. Made the following schema but unfortunately it doesn't validate. Could someone please indicate what is wrong or give me other solution. Thanks Very much. Regards ------------------------------------------------------------------------------------------------------------------ Schema:
8
7209
by: Marc | last post by:
Hi all, I have to generate and send to a printer many 6 digit alphanumeric strings. they have to be unique but I cannot check in a database or something like that if it have already been printed. the string has also to seem a random one and it cannot have an apparence of a sequence. My first approach is to do it with a decimal counter and find and use an encryption alghorithm that converts each 6 digit decimal number to a 6 digit...
14
6589
by: Maxximvs | last post by:
G'day Having a day where the brain noodle will not comprehend so I though I'd post the question. I have a table (called Vendors) which has two fields (Sequence, a unique number but not marked as a Primary Key, though it basically is one, and VendorName, the name of the Vendor) and once a month I get a list from the shipping dept of new vendors. This list comes in Excel, so I import the sheet into Access and run an Insert Query to place...
1
2659
by: reachkaruna | last post by:
Hi All, I have the following XSD where my "number" is having unique constarint <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"> <xs:element name="root"> <xs:complexType> <xs:sequence> <xs:element ref="number"/>
0
9645
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
9481
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
10341
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9954
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
8979
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...
0
5383
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...
1
4054
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

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.