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 Geoff Granum <gr...@purdue.edu> on 2003/10/22 00:28:47 UTC

Re: accessing schema validated values

Novice here, but how about setting a constant when the wrapper Object is 
created such that one can call a function and get an integer constant which 
represents the data type. For example

public static final int DOUBLE = 0, INT = 1, BOOLEAN = 2 ... etc;
protected int validatedValueType = -1;

public int getValidatedValueType() throws ...{
	if(validatedValueType == -1){
		throw new some_NotInitiatedException();
	}
	return validatedValueType
}

The value of validatedValueType is set when the Object representing the 
actual ValidatedValue is set.

Just a thought.
-- 
Geoff Granum
granum@purdue.edu
Aeronautical & Astronautical Engineering,
Purdue University
West Lafayette, Indiana

On Tue, 21 Oct 2003 17:29:18 -0400, Elena Litani <el...@ca.ibm.com> 
wrote:

> Hi Christian,
>
> Thank you for your reply.
>
> Christian Schuhegger wrote:
>
>> Your proposal to expose the validated values in the ItemPSVI classes
>> sounds like a very good idea to me. Perhaps it is possible to extend the
>> internal data representation classes like the XDecimal to return actual
>> Java object representations of the basic types in parallel to extend the
>> ItemPSVI interfaces?
>
> I believe the ItemPSVI interface should have only one method that
> returns an Object representing the actual value. Given that, you will
> need to have bunch of instanceof checks in your code to be able to cast
> to the internal Xerces representation, i.e. XDecimal, and then get a
> Java decimal (a method could be defined on XDecimal). Are you fine with
> this solution?
>
> There are couple of alternative solutions, so if you want to discuss it
> lets do it on the xerces-j-dev mailing list.
>
>
>> While I am just writing this e-mail I would also like to ask if there is
>> a way to perform partial validation of XML documents? I mean, I have
>> only seen a normalizeDocument() method on the Document class, but what I
>> would like to be able to do is to validate parts of a document below the
>> document root, too. Is there a way to achieve that? Or is this feature
>> perhaps planned for a future release?
>
> See email below.
>
> Thank you,




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