473,394 Members | 1,722 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,394 software developers and data experts.

XML Schema Issues

Hi everyone. I have couple problems with xsd file i'm trying to
create.

first question. is it possible to restrict year input to current year?
I mean i don't want to put
<xs:restriction base="xs:integer">
<xs:minInclusive value="1900" />
<xs:maxInclusive value="2007" />
</xs:restriction>
and then i have to change next year to <xs:maxInclusive value="2008" /
>. is there any way to put getdate() or now() type functions.
second question. is it possible to make one of elements required or
optional depending on the value of the previous element? I realize i
can use "choice" indicator with 2 different elements, but may be there
is another way to do it.
thirs question is related to second. Is it possible to restrict the
value of the element to the value of the one of previous elements.
like
<xs:element name="id" minOccurs="1" type="xs:integer" />
....
<xs:element name="anotherId" minOccurs="1">
<xs:simpleType>
<xs:restriction base="xs:integer">
<the value of 'anotherId' must be only one of values
entered in 'id' element>
</xs:restriction>
</xs:simpleType>
</xs:element>

sorry, if questions sound stupid. i'm new in xml schema.
may be the only way to fix this issues is to deal with them when
parsing xml docs.
thanks in advance for any help.

Jun 28 '07 #1
2 1422
<?xml version="1.0" encoding="utf-8" ?>
<quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="test.xsd">
<vehicle>
<id>1</id>
<year>2020</year>
</vehicle>
<vehicle>
<id>2</id>
<year>2019</year>
</vehicle>
<driver>
<vehicleId>1</vehicleId>
</driver>
</quote>
Hi guys. i need to put in xml schema that each vehicle/id is unique
and each driver/vehicleid has a corresponding vehicle/id.
I know i have to use key, keyref stuff. but cannot figure out how. i
guess i'm lost in xmlpaths.
thx in advance.

Jun 28 '07 #2
thx again. Joe.

I fixed that issue with key and keyref. I had some problems with
xmlpath, but now it's all good.

Jun 29 '07 #3

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

Similar topics

2
by: Json | last post by:
Ok, brand new to SQLXML 3.0 and its various issues. Heres what I'm trying to do: 1. I am trying to load xml data into an empty SQL table from my .NET console application. 2. This isn't a huge...
3
by: N. Shamsundar | last post by:
In DB2 V8.1.5, if one uses SET SCHEMA to a schema other than the default schema, and subsequently issues a LIST TABLES command, it is still the tables in the default schema that are shown. Is this...
5
by: dave71 | last post by:
Hi Could someone please advise me how to remove the schema name from linked tables within Access. For example when I connect to a Oracle database via Microsoft ODCB for Oracle the list of...
3
by: Dave | last post by:
Hi, I'm really confused as to how to validate XML fragments against a schema in C#. I am creating XML through an automated process and have an .xsd which was given to me to validate against....
6
by: Lee Harr | last post by:
I have a database where I remove the schema public. When I try to use the createlang script, it fails like this ... >createdb foo CREATE DATABASE >psql foo -c "select version()" version...
2
by: Doru Roman | last post by:
Hi, I use C# to validate an XML document. It issues error messages and I do not understand why. Here is the XML document: <bookstore xmlns="http://tempuri.org/books.xsd"> <book...
2
by: Mark | last post by:
Hi... I've been trying the .Validate() method on the XmlDocument to validate some xml against a schema, but one thing I noted was that unless the document explicitly declares the schema as a...
5
by: Sek | last post by:
Hi Folks, I would like to create a XML file that adhere to the Schema definition files. My schema definition files import/include further XSD files and internal references can be to a depth...
2
by: Amber | last post by:
On my DB2 UDB 8.2.7 database user User1 has been granted IMPLICIT_SCHEMA privilege, but when he issues "create schema test", the error message "SQL0552N, USER1 does not have the previliege to...
2
by: pnmcosta | last post by:
Hi, I'm fairly new to XML Schema validation. We have XML being imported that must validate against the following schema: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
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...
0
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...
0
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...

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.