473,766 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XML Schema not working

AIML Schema: http://209.168.21.76/CommunityStarte...loads/258.aspx

I have a Schema (in the link above) that I've been trying to make work in
VS2003 for a while now and just can't seem to get right. I didn't design the
schema and to tell the truth, most of it is beyond my rudimentary
understanding of XML.

So far, the main problem I've run into is the simpleType below:

<simpleType name="VariableN ame">

<restriction base="string">

<attribute name="name" type="string" />

</restriction>

</simpleType>

I understand that attributes can't be embedded in simpleType's and I'm not
really sure what the attribute is supposed to accomplish anyway. The first
thing I did to try and understand the problem is to remove the attribute. In
an XML file with the AIML targetSchema this led to the error "Undefined
complexType aiml:VariableNa me is used as a base for complex type
restriction." in the complexType below.

<complexType name="SetVar">

<simpleConten t>

<restriction base="aiml:Vari ableName" />

</simpleContent>

</complexType>

The next step was to convert VariableName to a complexType:

<complexType name="VariableN ame">

<simpleConten t>

<restriction base="string" />

</simpleContent>

</complexType>

This led to the error "Undefined complexType
http://www.we.org/2001/XMLSchema:string is used as a base for complex type
restriction" in VariableName. In a final act of desperation I replaced the
attribute from the original simpleType:

<complexType name="VariableN ame">

<simpleConten t>

<restriction base="string">

<attribute name="name" type="string" />

</restriction>

</simpleContent>

</complexType>

I'm not sure why the attribute was accepted here but it was. However, the
error was the same as above: Undefined complexType string.

Can somebody help me with this thing? It's starting to make me a little
crazy...
Nov 12 '05 #1
2 2818

Yes, there are tons of problems with this schema. First you cannot declare
attributes in a simpleType. SimpleTypes are limited to primitive values
only. Looking at the schema I think they really wanted the following:
<complexType name="SetVar">
<attribute name="name" type="string"/>
</complexType>

and
<complexType name="GetVar">
<attribute name="name" type="string"/>
</complexType>

and then I get a different problem which is that on the following you are
not allowed to specify both a name attribute and a ref attribute:

<element name="li" ref="aiml:Condi tionItem" maxOccurs="unbo unded"/>

This is fixed by changing the ref= to a type=

But then the following "li" element becomes ambiguous, so I would just
delete that, not sure what they were trying to achieve there.

Then you get more errors:
Warning 1 Undefined complexType
'http://alicebot.org/AIMLSchema:Patt ernExpression' is used as a base for
complex type restriction. C:\temp\AIML.xs d 44 5 Miscellaneous Files
Warning 2 Undefined complexType 'http://www.w3.org/2001/XMLSchema:strin g' is
used as a base for complex type restriction. C:\temp\AIML.xs d 92 5
Miscellaneous Files

Looks like they are trying to add attributes, so these should be extensions
of simpleType not restrictions, as follows:

<complexType name="If">
<simpleConten t>
<extension base="string">
<attribute name="expr" type="aiml:Java ScriptExpressio n"/>
</extension>
</simpleContent>
</complexType>

and

<complexType name="Pattern">
<simpleConten t>
<extension base="aiml:Patt ernExpression"/>
</simpleContent>
</complexType>

Now it finally compiles cleanly.

"Chuck Bowling" <ch**********@s bcglobal-NO-SPAM.net> wrote in message
news:ez******** ******@TK2MSFTN GP15.phx.gbl...
AIML Schema: http://209.168.21.76/CommunityStarte...loads/258.aspx

I have a Schema (in the link above) that I've been trying to make work in
VS2003 for a while now and just can't seem to get right. I didn't design
the schema and to tell the truth, most of it is beyond my rudimentary
understanding of XML.

So far, the main problem I've run into is the simpleType below:

<simpleType name="VariableN ame">

<restriction base="string">

<attribute name="name" type="string" />

</restriction>

</simpleType>

I understand that attributes can't be embedded in simpleType's and I'm not
really sure what the attribute is supposed to accomplish anyway. The first
thing I did to try and understand the problem is to remove the attribute.
In an XML file with the AIML targetSchema this led to the error "Undefined
complexType aiml:VariableNa me is used as a base for complex type
restriction." in the complexType below.

<complexType name="SetVar">

<simpleConten t>

<restriction base="aiml:Vari ableName" />

</simpleContent>

</complexType>

The next step was to convert VariableName to a complexType:

<complexType name="VariableN ame">

<simpleConten t>

<restriction base="string" />

</simpleContent>

</complexType>

This led to the error "Undefined complexType
http://www.we.org/2001/XMLSchema:string is used as a base for complex type
restriction" in VariableName. In a final act of desperation I replaced the
attribute from the original simpleType:

<complexType name="VariableN ame">

<simpleConten t>

<restriction base="string">

<attribute name="name" type="string" />

</restriction>

</simpleContent>

</complexType>

I'm not sure why the attribute was accepted here but it was. However, the
error was the same as above: Undefined complexType string.

Can somebody help me with this thing? It's starting to make me a little
crazy...

Nov 12 '05 #2
Thanks a lot for your help Chris. I managed to get it to compile down to the
last tag. After which I get this error when I try to derive a new XML file
using the schema:

Undefined data type: PatternExpressi on.

PatternExpressi on is defined in line 47...

<simpleType name="PatternEx pression">

<restriction base="string">

<minLength value="1" />

<pattern value="(\d|\p{L u}|\s)+(\*|_)(( \d|\p{Lu}|\s)*) " />

<pattern value="(\*|_)(( \d|\p{Lu}|\s)*) " />

<pattern value="(\d|\p{L u}|\s)+" />

</restriction>

</simpleType>
"Chris Lovett" <so*****@nospam .please> wrote in message
news:NZ******** ************@co mcast.com...

Yes, there are tons of problems with this schema. First you cannot
declare attributes in a simpleType. SimpleTypes are limited to primitive
values only. Looking at the schema I think they really wanted the
following:
<complexType name="SetVar">
<attribute name="name" type="string"/>
</complexType>

and
<complexType name="GetVar">
<attribute name="name" type="string"/>
</complexType>

and then I get a different problem which is that on the following you are
not allowed to specify both a name attribute and a ref attribute:

<element name="li" ref="aiml:Condi tionItem" maxOccurs="unbo unded"/>

This is fixed by changing the ref= to a type=

But then the following "li" element becomes ambiguous, so I would just
delete that, not sure what they were trying to achieve there.

Then you get more errors:
Warning 1 Undefined complexType
'http://alicebot.org/AIMLSchema:Patt ernExpression' is used as a base for
complex type restriction. C:\temp\AIML.xs d 44 5 Miscellaneous Files
Warning 2 Undefined complexType 'http://www.w3.org/2001/XMLSchema:strin g'
is used as a base for complex type restriction. C:\temp\AIML.xs d 92 5
Miscellaneous Files

Looks like they are trying to add attributes, so these should be
extensions of simpleType not restrictions, as follows:

<complexType name="If">
<simpleConten t>
<extension base="string">
<attribute name="expr" type="aiml:Java ScriptExpressio n"/>
</extension>
</simpleContent>
</complexType>

and

<complexType name="Pattern">
<simpleConten t>
<extension base="aiml:Patt ernExpression"/>
</simpleContent>
</complexType>

Now it finally compiles cleanly.

"Chuck Bowling" <ch**********@s bcglobal-NO-SPAM.net> wrote in message
news:ez******** ******@TK2MSFTN GP15.phx.gbl...
AIML Schema:
http://209.168.21.76/CommunityStarte...loads/258.aspx

I have a Schema (in the link above) that I've been trying to make work in
VS2003 for a while now and just can't seem to get right. I didn't design
the schema and to tell the truth, most of it is beyond my rudimentary
understanding of XML.

So far, the main problem I've run into is the simpleType below:

<simpleType name="VariableN ame">

<restriction base="string">

<attribute name="name" type="string" />

</restriction>

</simpleType>

I understand that attributes can't be embedded in simpleType's and I'm
not really sure what the attribute is supposed to accomplish anyway. The
first thing I did to try and understand the problem is to remove the
attribute. In an XML file with the AIML targetSchema this led to the
error "Undefined complexType aiml:VariableNa me is used as a base for
complex type restriction." in the complexType below.

<complexType name="SetVar">

<simpleConten t>

<restriction base="aiml:Vari ableName" />

</simpleContent>

</complexType>

The next step was to convert VariableName to a complexType:

<complexType name="VariableN ame">

<simpleConten t>

<restriction base="string" />

</simpleContent>

</complexType>

This led to the error "Undefined complexType
http://www.we.org/2001/XMLSchema:string is used as a base for complex
type restriction" in VariableName. In a final act of desperation I
replaced the attribute from the original simpleType:

<complexType name="VariableN ame">

<simpleConten t>

<restriction base="string">

<attribute name="name" type="string" />

</restriction>

</simpleContent>

</complexType>

I'm not sure why the attribute was accepted here but it was. However, the
error was the same as above: Undefined complexType string.

Can somebody help me with this thing? It's starting to make me a little
crazy...


Nov 12 '05 #3

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

Similar topics

0
4226
by: C. M. Sperberg-McQueen | last post by:
wooks (wookiz@hotmail.com) wrote: > <?xml version='1.0'?> > <userlogin xmlns="urn:faster:userlogin" > xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> > <login>mick</login> > <password>brown</password> > </userlogin> > Above is my schema instance.
6
2489
by: Pieter | last post by:
I've read a lot of posts on "why relax ng is so very good" and on "why w3c xml schema should be the only schema language". I'm, however, still not clear on why I should prefer one over the other. I've made a small list of some good and bad points of both. These points don't really go into the grammar aspects of these languages, but are more about secondary aspects. The grammar aspects are different, but both are suitable for validating...
4
5608
by: joes | last post by:
Hello there I tried for several days to get a simple validation with xml schema & xerces working. Goal for me is tuse JAXP and not specific Xerces classes. I don't get the point what I am doing wrong. Could somebody help me? I didn't find any full example working on the net. Thank you for any hints! If I run the examples below, the parsers parses the file well, no vlaidation is occuring although the schema and xml file does not
3
1920
by: william_hulse | last post by:
The general process i am currently working on is this: STEP 1 xml doc1 is transformed using stylesheet1 to produce xml doc2 - xml doc1 has a namespace declaration as follows... <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?> <?xml-stylesheet type="text/xsl" href="G:\Working\User\Will_Hulse\NEW\xmldb\code\Bank_Statements_Schema\EXBAEUFRED01.xsl"?>
10
43222
by: wackyphill | last post by:
I know in SQL Server the terms Database and Catalog are used interchangably. But a table is also assigned a schema. As seen in the INFORMATION_SCHEMA.Tables View. I don't get what this schema qualifier is all about. Like if a table has a schema of dbo. Can someone explain the relationship the schema has and what it is? Thanks.
8
2814
by: Poonam | last post by:
Hi, Can some one please help me with (or point me to) a very simple but working code sample that shows how to import XML Schema. I have tried many samples out there on internet but nothing seems to be working. I am trying to import a complex type/simple type element type from an external xml schema. I am using xs:import tag with namespace and schemalocation attributes defined and have also declared xmlns relative to this xml schema. I...
0
11273
by: Derek | last post by:
I am creating an intranet using Visual Web Developer Express Edition. Everything has been working OK until yesterday when I started getting 62 messages all beginning "Could not find schema information for the". I am using Cassini as the web server on my PCand I can still run my site from within VWD. Does anyone know what I have done to cause these messages to appear? Could not find schema information for the element...
5
1204
by: Reuven Nisser | last post by:
Hi, How can I describe an XML like this: <X> <Y/> <Z/> <Y/> <Y/> </X>
3
2174
by: Chris Lieb | last post by:
I am new to XML Schema and am running into a bit of a snag. I have defined an XML-based scripting language for an updater program that I am working on. I would like to make a schema for this language since malformed XML documents break the updater. (I did not have time to add good error-handling code, so run-time errors can abound if the document is malformed.) A sample doc might look something like this: <manifest>
4
1221
by: cmay | last post by:
I am beginning to wonder if it is not possible to get this working. I am trying to do: <root> <a/> <b/> <c/> </root>
0
9404
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
10168
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...
1
9959
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
8835
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
7381
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
6651
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
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.