You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Dale Manny <dm...@tidestone.com> on 2000/10/12 17:30:31 UTC

RE: simpleType and restriction problem - also trivial bug in DOMC ount

Stefan is not the only one to encounter this.  I am new enough to XML Schema
to not know if there is something wrong.  I encountered essentially the same
thing in my first day working with Schema support.  I have had this issue on
my list to revisit along with the following far simpler one.

DOMCount has a minor inconsistency with regard to the validation argument.
In the program's usage text it says:

          usage: java dom.DOMCount (options) uri ...

          options:
            -p name  Specify DOM parser wrapper by name.
            -n | -N  Turn on/off namespace [default=on]
            -v | -V  Turn on/off validation [default=on]
            -s | -S  Turn on/off Schema support [default=on]
            -d | -D  Turn on/off deferred DOM [default=on]
            -h       This help screen.

All of the default values are shown to be 'on'.  However the initial values
assigned to the internal variables for theses switches are in the following
code fragment:

              private static boolean setValidation    = false; //defaults
              private static boolean setNameSpaces    = true;
              private static boolean setSchemaSupport = true;
              private static boolean setDeferredDOM   = true;

The initial value of setValidation does result in the contradiction that can
be expected.  In so much as there may be users with test scripts based on
DOMCount, changing the boolean to true might be disruptive.  Changing the
text will probably only affect humans.



-----Original Message-----
From: Stefan Krause [mailto:kuerbis11@hotmail.com]
Sent: Thursday, October 12, 2000 6:36 AM
To: xerces-j-dev@xml.apache.org
Subject: simpleType and restriction problem


I'm seeking for help for a problem with a schema. I can't get examples from 
http://www.w3.org/TR/xmlschema-2/ to work that use a simpleType and 
restriction. Maybe you can tell me what I'm doing wrong.

Thanks,
Stefan

------------ My XML-File:
<?xml version="1.0"?>
<test xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
	   xsi:noNamespaceSchemaLocation="my.xsd">
Hallo
</test>

------------ My Schema:
<?xml version="1.0" encoding="UTF-8"?>
<schema xlmns="http://www.w3.org/1999/XMLSchema">

<element name="test" type="MyType"/>

<!-- This here works fine:
<simpleType name="MyType" base="string">
</simpleType>
-->

<simpleType name='MyType'>
  <restriction base='string'>
    <maxLength value='50'/>
  </restriction>
</simpleType>

</schema>

------------ Error reported from "dom.DOMCount -v my.xml"

[Error] my.xml:3:44: Unknown base type  for type MyType.
[Error] my.xml:3:44: Unknown base type  for type MyType.
my.xml: 344 ms (1 elems, 2 attrs, 0 spaces, 7 chars)

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.

Share information about yourself, create your own public profile at 
http://profiles.msn.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-dev-help@xml.apache.org