Hi,
I'm currently busy writing an xsd at one point in time i whish that my xml must look like: - <object>
-
<loc>
-
<disk>
-
<drive>c</drive>
-
<path>temp\path</path>
-
<files>*.*</files>
-
</disk>
-
</loc>
-
<interval>
-
...
-
</interval>
-
</object>
or (choice) - <object>
-
<loc>
-
<network>
-
<server>localhost</server>
-
<path>temp\path</path>
-
<files>*.*</files>
-
</network>
-
</loc>
-
<interval>
-
...
-
</interval>
-
</object>
-
or (another choice) - <object>
-
<loc>
-
<internet>
-
<uri>123.456.789.123</uri>
-
<path>temp\path</path>
-
<files>*.*</files>(optional (if webservice))
-
<port>8888</port>(optional)
-
....
-
</internet>
-
</loc>
-
<interval>
-
...
-
</interval>
-
</object>
-
so the <loc> tag can contain (in my case) 5 different objects, which are all locations of some sorts. But the <loc> tag may only contain one (complex) child, which can be either an <internet>tag , a <network> tag or a <disk> tag.
How to get to my question: How do I pull this off in my XSD?
This is what I tried: - <xs:complexType name="Location">
-
<xs:sequence maxOccurs="1" minOccurs="1">
-
<xs:choice maxOccurs="1" minOccurs="1">
-
<xs:element name="localDisk" type="LocalDisk" maxOccurs="1" minOccurs="0" />
-
<xs:element name="networkLocation" type="NetworkLocation" maxOccurs="1" minOccurs="0" />
-
<xs:element name="internetSite" type="InternetSite" maxOccurs="1" minOccurs="0" />
-
<xs:element name="secureInternetSite" type="SecureInternetSite" maxOccurs="1" minOccurs="0" />
-
<xs:element name="ftpSite" type="FtpSite" maxOccurs="1" minOccurs="0" />
-
</xs:choice>
-
</xs:sequence>
-
</xs:complexType>
-
-
<xs:complexType name="TextDataProvider">
-
<xs:sequence>
-
<xs:element name="location" type="Location" maxOccurs="1" minOccurs="1" />
-
<xs:element name="interval" type="Interval" maxOccurs="1" minOccurs="1" />
-
<xs:group ref="textSchema" maxOccurs="1" minOccurs="1" />
-
</xs:sequence>
-
<xs:attributeGroup ref="Identification" />
-
</xs:complexType>
-
-
<xs:complexType name="Configuration">
-
<xs:sequence>
-
<xs:choice maxOccurs="3" minOccurs="1">
-
<xs:element name="textProviders" maxOccurs="unbounded" minOccurs="1" type="TextDataProviders" />
-
<xs:element name="csvProviders" maxOccurs="unbounded" minOccurs="0" type="CsvDataProviders" />
-
<xs:element name="xmlProviders" maxOccurs="unbounded" minOccurs="0" type="XmlDataProviders" />
-
</xs:choice>
-
</xs:sequence>
-
</xs:complexType>
-
-
<xs:element name="configuration" type="Configuration"></xs:element>
-
-
<xs:complexType name="TextDataProviders">
-
<xs:sequence>
-
<xs:element name="dataprovider" type="TextDataProvider" minOccurs="0" maxOccurs="unbounded" />
-
</xs:sequence>
-
</xs:complexType>
-
But that doesn't do the trick, because when I'm forming an xml based on this xsd I can add as many locations of any kind within the location tag
I must be doing something wrong, I just can't see it at this time.
With kind regards,
- SL33PY
1 1501
I've been thinkering a bit, as well as reading some additional sources and I made a temp xsd and xml:
The temp xsd: - <?xml version="1.0" encoding="utf-8" ?>
-
<xs:schema targetNamespace="XMLSchema1.xsd" elementFormDefault="qualified" xmlns="XMLSchema1.xsd"
-
xmlns:mstns="XMLSchema1.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
-
<xs:element name="Configuration">
-
<xs:annotation>
-
<xs:documentation>
-
This tag describes the configuration of the system.
-
It consists of maximum 3 childs representing the different kinds of
-
providers that our application can process. Every child represents a group
-
of data providers of a specific kind.
-
</xs:documentation>
-
</xs:annotation>
-
<xs:complexType>
-
<xs:choice minOccurs="1" maxOccurs="3">
-
<xs:element name="TextProviders" maxOccurs="1" minOccurs="0" type="xs:string" /><!--type="TextProvidersType" />-->
-
<xs:element name="CsvProviders" maxOccurs="1" minOccurs="0" type="xs:string" /><!--type="CsvProvidersType" />-->
-
<xs:element name="XmlProviders" maxOccurs="1" minOccurs="0" type="xs:string" /><!--type="XmlProvidersType" />-->
-
</xs:choice>
-
</xs:complexType>
-
</xs:element>
-
</xs:schema>
The temp xml: -
<?xml version="1.0" encoding="utf-8" ?>
-
<Configuration xmlns="XMLSchema1.xsd">
-
<CsvProviders></CsvProviders>
-
<TextProviders></TextProviders>
-
<XmlProviders></XmlProviders>
-
</Configuration>
-
at this moment it works, but...
I adjusted my older xsd file and the xsd gets validated, still I cannot select it from the list (VS 2003) in the targetnamespace property field, I can select the xmlschema1.xsd but not my bigger one :confused:
I'll expand this test xsd and perhaps I can find out why the other doesn't work as intended. If anyone has hints/tips/more insight, please let me know asap
- SL33PY
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: James Bright |
last post by:
I have set up custom Intellisense for our project. (In a nutshell, we will
have ASP.NET controls based on many of the statndard WebControls, but with a
few extensions that we will be adding). I've put a custom XSD in the
schemas\xml directory and it works pretty great. It's largely based on the
asp.xsd.
My problem is that while this works great for most controls, providing
Intellisense whenever I have:
<foo:FooTextBox runat=server......
|
by: aka |
last post by:
Hi
I have a DB2 v8.1 on AIX and DB2 Connect EE on Solaris wich is connected to
OS/390 DB2 subsystems via APPC / SNA. I have cataloged the DB2 Connect
instance as tcpip node and then the Host DB cataloged on that node...this
works from v7.2 Fixpack 11 clients and servers, but with v8.1 server I get
SQL1334N.
Does anyone has an idea?
Thanks
|
by: Julia |
last post by:
Hi,
I am still having Charest conversion
difficulties s when passing string from C# TO ASP and than to access using
ADO
I am using HttpWebRequest to POST some Multilanguage(Hebrew and English)
to an ASP page which in turn uses ADO to save them to an access data base
the access data base support(as I underatdn( UNICODE strings),I can insert
Hebrew string fro access IDE)
|
by: Edward Diener |
last post by:
Why is it impossible to have a __value class instance variable in a __nogc
class when it is possible to have a built-in type instance variable in a
__nogc class ?
__value class X { int a; };
__nogc class Y { X b; int c;}; // compiler error
__nogc class Y { int c;}; // OK
|
by: Jordan Tiona |
last post by:
I can't get this code to work right. It seems to be skipping some of the cin
functions. Can someone help me with this?
ClassTrack.cpp:
#include <iostream>
#include "ClassTrack.h"
using namespace std;
const MAX_CLASSES = 12;
| |
by: jg.campbell.ng |
last post by:
I'm beginning learning Python and OpenGL in Python.
Python fine. But difficulties with OpenGL; presumably with the
installation of OpenGL.
OS = Linux FC5.
Python program gl_test.py:
from OpenGL.GLUT import *
|
by: bau |
last post by:
Hi everybody,
I am using MS Access 2003 to prepare data for a scientific study. I
have a table which look like that:
"Customer" "Store" "Product" "Price" "week"
"100" "Supermarket1" "XProduct" 2,20 $ 5
"101" "Supermarket2" "YProduct" 2,05 $ 2
"102" "Supermarket1" "ZProduct" 2,10 $ 1
"103" "Supermarket2" "XProduct" 2,05 $ 3
|
by: RazSam |
last post by:
Hi
I am developing in c# .net 2,0 web forms and having some problems. Code is attached below.
I have written code to export the contents of a Grid View to Excel, this works. The problem occurs when i change the contents of the datagrid such as apply a row filter to it. The new records have been binded to the datasource.
I try to export those results to Excel but seem to the whole datagrid contents into Excel instead of the filtered...
|
by: cmb3587 |
last post by:
I am having a problem with the validation of the account number and password.
The beginning of the program asks for users account # then pwd. The program is then supposed to go to a checkID method that checks the account number and pwd with 3 stored accounts (each account/pwd/balance is stored as one long string) so the checkID method breaks up the string into its seperate parts and then checks if the input matches. If it does match one of...
|
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...
|
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...
| |
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,...
|
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...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
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...
| |