Thanks Alberto,

It turns out my code was in fact the problem - I thought I had turned on all of the things necessary for validation, but in fact I had not. Problem solved - thanks and I feel stupid ;-)

Steve Harrington
National Radio Astronomy Observatory

Alberto Massari wrote:
Hi Steve,
you haven't posted the code you use to perform the validation: did you check you are turning on both namespace processing and validation?


Alberto

At 14.57 16/11/2004 -0700, Steve Harrington wrote:

Hi,

I must be doing something wrong, but it seems that xerces isn't finding my schema (mentioned in my schemalocation hint in my instance document). I searched for answers on the archive and also on the web, but have not found anything that has worked.

Here are my files:


------------------ XML instance doc (file psetdef.xml) ----------------

<?xml version="1.0" encoding="UTF-8"?>
<psetdefTypes:parameterset xmlns:psetdefTypes="http://www.aoc.nrao.edu/~sharring/psetdefTypes.html";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://www.aoc.nrao.edu/~sharring/psetdefTypes.html
file:///export/home/newbie/sharring/Dev/HEAD/ACS/LGPL/CommonSoftware/task/bin/psetdef.xsd">


<!-- This is a sample parameter set for vla filler -->
<name>vlafillertest</name>
<comment>using vla filler as an example</comment>
<parameter xsi:type="psetdefTypes:StringParameterType">
<name>msname</name>
<required>true</required>
<prompt>e.g. myvladata.ms</prompt>
<help>name of output ms</help>
</parameter>
<parameter xsi:type="psetdefTypes:StringParameterType">
<name>inputfile</name>
<required>true</required>
<prompt>e.g. c477_040502.xpl</prompt>
<help>name of vla archive</help>
</parameter>
<parameter xsi:type="psetdefTypes:StringParameterType">
<name>project</name>
<required>false</required>
<prompt>e.g. ad577</prompt>
<help>name of project to extract, defaults to all projects in input</help>
<default>all</default>
</parameter>
<parameter xsi:type="psetdefTypes:StringParameterType">
<name>start</name>
<required>false</required>
<prompt>e.g. 2004/05/02/18:30:00</prompt>
<help>start time to extract</help>
<default>beginning of input file</default>
</parameter>
<parameter xsi:type="psetdefTypes:StringParameterType">
<name>stop</name>
<required>false</required>
<prompt>e.g. 2004/05/02/19:00:00</prompt>
<help>end time of extracted data</help>
<default>end of input file</default>
</parameter>
<parameter xsi:type="psetdefTypes:DoubleParameterType">
<name>centerfreq</name>
<required>false</required>
<prompt>e.g. 1.489 GHz</prompt>
<help>frequency of data to extract (used along with bandwidth parameter)</help>
<units>Ghz</units>
<stringdefault>all</stringdefault>
</parameter>
<parameter xsi:type="psetdefTypes:DoubleParameterType">
<name>bandwidth</name>
<required>false</required>
<prompt>e.g. 10.01 Mhz</prompt>
<help>data around centerfreq to get out</help>
<stringdefault>all</stringdefault>
</parameter>
<parameter xsi:type="psetdefTypes:StringParameterType">
<name>bandname</name>
<required>false</required>
<prompt>e.g. P</prompt>
<help>name of band to extract</help>
<stringdefault>all</stringdefault>
<length>1</length>
</parameter>
<parameter xsi:type="psetdefTypes:StringParameterType">
<name>source</name>
<required>false</required>
<prompt>e.g. 3C49 or 1338+4995</prompt>
<help>name of source</help>
<default>all</default>
</parameter>
<parameter xsi:type="psetdefTypes:BooleanParameterType">
<name>overwrite</name>
<required>false</required>
<prompt>e.g. true or false</prompt>
<help>overwrite or append</help>
<default>false</default>
</parameter>
</psetdefTypes:parameterset>


---------------- XSD schema doc (file psetdef.xsd) --------------------------

<xsd:schema targetNamespace="http://www.aoc.nrao.edu/~sharring/psetdefTypes.html";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:psetdefTypes="http://www.aoc.nrao.edu/~sharring/psetdefTypes.html";>


   <xsd:annotation>
         <xsd:documentation xml:lang="en">
   Schema for the definition of parameter sets for OFFLINE Tasks.
   Copyright 2004 NRAO, all rights reserved.
        </xsd:documentation>
   </xsd:annotation>
        <!--

***************************************************************************

There is one required "root" element required that instances
of this schema must define:
parameterset, which is of type ParameterSetType (defined below)


**************************************************************************

-->
<xsd:element name="parameterset" type="psetdefTypes:ParameterSetType"/>
<!--


**************************************************************************

ParameterSetType contains:
comment: string containing an optional comment about the parameter set
parameter: (1 or more) something which descends from the abstract ParameterType


**************************************************************************

-->
<xsd:complexType name="ParameterSetType">
<xsd:sequence>
<xsd:element name="name" type="xsd:string"/>
<xsd:element name="comment" type="xsd:string" minOccurs="0"/>
<xsd:element name="parameter" type="psetdefTypes:ParameterType" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!--


**************************************************************************

The abstract type for parameters which all parameters extend.
mandatory parameters for all ParameterType descendents:
name: string name of the parameter
required: boolean indicating if the parameter is required (true) or optional/hidden (false)
prompt: string containing the short help text for the parameter
help: string containing the longer, more verbose help text for the parameter


**************************************************************************

        -->
        <xsd:complexType name="ParameterType" abstract="true">
                <xsd:sequence>
                        <xsd:element name="name" type="xsd:string"/>
                        <xsd:element name="required" type="xsd:boolean"/>
                        <xsd:element name="prompt" type="xsd:string"/>
                        <xsd:element name="help" type="xsd:string"/>
                </xsd:sequence>
        </xsd:complexType>

<!--

**************************************************************************

The abstract type for mumeric quantity parameters:
units: (optional) string containing the unit of measure of the quantity


**************************************************************************

-->
<xsd:complexType name="QuantityParameterType" abstract="true">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:ParameterType">
<xsd:sequence>
<xsd:element name="units" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>


<!--

**************************************************************************

Used to define integer parameters. Inherits all the elements
of ParameterType and adds the following:
default: the value for the parameter to be used if unspecified
min:(optional) minimum value for the parameter
max:(optional) maximum value for the parameter
validValues: (optional) enumeration of valid values for the parameter


**************************************************************************

-->
<xsd:complexType name="BooleanParameterType">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:ParameterType">
<xsd:sequence>
<xsd:element name="default" type="xsd:boolean" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>


        <!--

**************************************************************************

Used to define integer parameters. Inherits all the elements
of ParameterType and adds the following:
default: the value for the parameter to be used if unspecified
min:(optional) minimum value for the parameter
max:(optional) maximum value for the parameter
validValues: (optional) enumeration of valid values for the parameter


**************************************************************************

-->
<xsd:complexType name="IntegerParameterType">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:QuantityParameterType">
<xsd:sequence>
<xsd:element name="default" type="xsd:integer" minOccurs="0"/>
<xsd:element name="min" type="xsd:integer" minOccurs="0"/>
<xsd:element name="max" type="xsd:integer" minOccurs="0"/>
<xsd:element name="validValues" type="psetdefTypes:IntegerEnumType" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<!--


**************************************************************************

        Used to specify enumerations of integer  type.

**************************************************************************

-->
<xsd:complexType name="IntegerEnumType">
<xsd:sequence>
<xsd:element name="value" type="xsd:integer" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!--


**************************************************************************

Used to define double parameters. Inherits all the elements
of ParameterType and adds the following:
default: the value for the parameter to be used if unspecified
min:(optional) minimum value for the parameter
max:(optional) maximum value for the parameter
validValues: (optional) enumeration of valid values for the parameter


**************************************************************************

-->
<xsd:complexType name="DoubleParameterType">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:QuantityParameterType">
<xsd:sequence>
<xsd:element name="default" type="xsd:double" minOccurs="0"/>
<xsd:element name="min" type="xsd:double" minOccurs="0"/>
<xsd:element name="max" type="xsd:double" minOccurs="0"/>
<xsd:element name="validValues" type="psetdefTypes:DoubleEnumType" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<!--


**************************************************************************

        Used to specify enumerations of double  type.

**************************************************************************

-->
<xsd:complexType name="DoubleEnumType">
<xsd:sequence>
<xsd:element name="value" type="xsd:double" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!--


**************************************************************************

Used to define string parameters. Inherits all the elements
of ParameterType and adds the following:
default: the value for the parameter to be used if unspecified
min:(optional) minimum value for the parameter
max:(optional) maximum value for the parameter
validValues: (optional) enumeration of valid values for the parameter


**************************************************************************

-->
<xsd:complexType name="StringParameterType">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:ParameterType">
<xsd:sequence>
<xsd:element name="default" type="xsd:string" minOccurs="0"/>
<xsd:element name="min" type="xsd:string" minOccurs="0"/>
<xsd:element name="max" type="xsd:string" minOccurs="0"/>
<xsd:element name="length" type="xsd:integer" minOccurs="0"/>
<xsd:element name="validValues" type="psetdefTypes:StringEnumType" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<!--


**************************************************************************

        Used to specify enumerations of string type.

**************************************************************************

-->
<xsd:complexType name="StringEnumType">
<xsd:sequence>
<xsd:element name="value" type="xsd:string" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:complexType>
<!--


**************************************************************************

Abstract base type used to define array parameters.
Inherits all the elements of ParameterType and adds the following:
maxlen: (required) the maximum length of the array


**************************************************************************

-->
<xsd:complexType name="ArrayParameterType" abstract="true">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:ParameterType">
<xsd:sequence>
<xsd:element name="maxlen" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<!--


**************************************************************************

Abstract base type used to define array quantity parameters.
Inherits all the elements of ArrayParameterType and adds the following:
units: (optional) the unit of measure for each item of the array


**************************************************************************

-->
<xsd:complexType name="QuantityArrayParameterType" abstract="true">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:ArrayParameterType">
<xsd:sequence>
<xsd:element name="units" type="xsd:string" minOccurs="0"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<!--


**************************************************************************

Used to define integer array parameters.
Inherits all the elements of ArrayParameterType and adds the following:
default: (optional) 1 to N integer values for defaulting the array if it is not specified


**************************************************************************

-->
<xsd:complexType name="IntegerArrayParameterType">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:QuantityArrayParameterType">
<xsd:sequence>
<xsd:element name="default" type="xsd:integer" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<!--


**************************************************************************

Used to define double array parameters.
Inherits all the elements of ArrayParameterType and adds the following:
default: (optional) 1 to N double values for defaulting the array if it not specified


**************************************************************************

-->
<xsd:complexType name="DoubleArrayParameterType">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:QuantityArrayParameterType">
<xsd:sequence>
<xsd:element name="default" type="xsd:double" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<!--


**************************************************************************

Used to define string array parameters.
Inherits all the elements of ArrayParameterType and adds the following:
default: (optional) 1 to N string values for defaulting the array if unspecified


**************************************************************************

-->
<xsd:complexType name="StringArrayParameterType">
<xsd:complexContent>
<xsd:extension base="psetdefTypes:ArrayParameterType">
<xsd:sequence>
<xsd:element name="default" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
</xsd:schema>


---------------------------------------------------

Sorry if that's overkill, but I figured I'd err on the side of too much info rather than too little. Basically, when I try to parse/validate this XML file using xerces DOM, I get lots of errors such as:

Error at file /export/home/newbie/sharring/Dev/HEAD/ACS/LGPL/CommonSoftware/task/bin/psetdef.xml, line 5, char 126
Message: Unknown element 'psetdefTypes:parameterset'


which indicates to me that it isn't finding my schema/xsd document per the schemalocation hint. I've tried fully-qualified path, just file name, file://file-name, etc. and no matter what, it never finds it. Any ideas what I've done wrong?

Thanks,

Steve Harrington
National Radio Astronomy Observatory

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to