Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » XML Schema Definition (XSD) » XSDConstrainingFacet.getEffectiveValue().toString()
XSDConstrainingFacet.getEffectiveValue().toString() [message #46993] Thu, 03 June 2004 15:59 Go to next message
Eclipse UserFriend
Originally posted by: NOpcooperSPAM.uk.ibm.com

I've been playing with Facets on simple types and I've encountered
exceptions being thrown when I call the toString() method on the
effective values of certain types of facet. For example, if I call it
for a hexBinary value in an enumeration as in the following example:

<schema targetNamespace="http://com/schemas/Example"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="CAType">
<sequence>
<element name="el60" type="xsd1:type60"/>
</sequence>
</complexType>

<simpleType name="type60">
<restriction base="hexBinary">
<enumeration value="0FB7ff01"/>
<enumeration value="0F56CCAABBAA"/>
<enumeration value="CABBA9E5000000"/>
</restriction>
</simpleType>
</schema>

I get:

java.lang.ArrayIndexOutOfBoundsException: -5
at org.eclipse.xsd.impl.type.DataValue$HexBin.encode(DataValue. java:454)
at
org.eclipse.xsd.impl.type.XSDHexBinaryType.getCanonicalLiter al(XSDHexBinaryType.java:44)
at
org.eclipse.xsd.impl.type.XSDAnySimpleType$ByteSequence.toSt ring(XSDAnySimpleType.java:73)
at java.lang.String.valueOf(String.java:2516)
at org.eclipse.emf.common.util.BasicEList.toString(BasicEList.j ava:1112)


Is there a better way for me to query these values or is this a bug?
I've also seen oddities when querying the value of time related simple
types, for example:

<simpleType name="type50">
<restriction base="gMonthDay">
<minInclusive value="--01-31+01:00"/>
<maxExclusive value="--02-07"/>
</restriction>
</simpleType>

The timezone seems to be replaced with an undisplayable character such
as the values: '--1-30Z' or '--2-7?'

Is there a way that I can retrieve those values from a schema in a
displayable way that doesn't require special logic for each data type?


Thanks,

Paul.
Re: XSDConstrainingFacet.getEffectiveValue().toString() [message #47025 is a reply to message #46993] Thu, 03 June 2004 16:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Paul,

I'll have a look. We've recently moved the implementation of the simple types from XSD to
Ecore and upgraded to using a copy of a more current Xerces implementation...


Paul Cooper wrote:

> I've been playing with Facets on simple types and I've encountered
> exceptions being thrown when I call the toString() method on the
> effective values of certain types of facet. For example, if I call it
> for a hexBinary value in an enumeration as in the following example:
>
> <schema targetNamespace="http://com/schemas/Example"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <complexType name="CAType">
> <sequence>
> <element name="el60" type="xsd1:type60"/>
> </sequence>
> </complexType>
>
> <simpleType name="type60">
> <restriction base="hexBinary">
> <enumeration value="0FB7ff01"/>
> <enumeration value="0F56CCAABBAA"/>
> <enumeration value="CABBA9E5000000"/>
> </restriction>
> </simpleType>
> </schema>
>
> I get:
>
> java.lang.ArrayIndexOutOfBoundsException: -5
> at org.eclipse.xsd.impl.type.DataValue$HexBin.encode(DataValue. java:454)
> at
> org.eclipse.xsd.impl.type.XSDHexBinaryType.getCanonicalLiter al(XSDHexBinaryType.java:44)
> at
> org.eclipse.xsd.impl.type.XSDAnySimpleType$ByteSequence.toSt ring(XSDAnySimpleType.java:73)
> at java.lang.String.valueOf(String.java:2516)
> at org.eclipse.emf.common.util.BasicEList.toString(BasicEList.j ava:1112)
>
> Is there a better way for me to query these values or is this a bug?
> I've also seen oddities when querying the value of time related simple
> types, for example:
>
> <simpleType name="type50">
> <restriction base="gMonthDay">
> <minInclusive value="--01-31+01:00"/>
> <maxExclusive value="--02-07"/>
> </restriction>
> </simpleType>
>
> The timezone seems to be replaced with an undisplayable character such
> as the values: '--1-30Z' or '--2-7?'
>
> Is there a way that I can retrieve those values from a schema in a
> displayable way that doesn't require special logic for each data type?
>
> Thanks,
>
> Paul.
Re: XSDConstrainingFacet.getEffectiveValue().toString() [message #47055 is a reply to message #46993] Thu, 03 June 2004 17:12 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

Paul,

Now that I look more closely, I see that the stack is showing that you are using the older
implementation of the datatypes, not the newer ones that are in Ecore now. I think it's
working properly in the latest driver.


Paul Cooper wrote:

> I've been playing with Facets on simple types and I've encountered
> exceptions being thrown when I call the toString() method on the
> effective values of certain types of facet. For example, if I call it
> for a hexBinary value in an enumeration as in the following example:
>
> <schema targetNamespace="http://com/schemas/Example"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <complexType name="CAType">
> <sequence>
> <element name="el60" type="xsd1:type60"/>
> </sequence>
> </complexType>
>
> <simpleType name="type60">
> <restriction base="hexBinary">
> <enumeration value="0FB7ff01"/>
> <enumeration value="0F56CCAABBAA"/>
> <enumeration value="CABBA9E5000000"/>
> </restriction>
> </simpleType>
> </schema>
>
> I get:
>
> java.lang.ArrayIndexOutOfBoundsException: -5
> at org.eclipse.xsd.impl.type.DataValue$HexBin.encode(DataValue. java:454)
> at
> org.eclipse.xsd.impl.type.XSDHexBinaryType.getCanonicalLiter al(XSDHexBinaryType.java:44)
> at
> org.eclipse.xsd.impl.type.XSDAnySimpleType$ByteSequence.toSt ring(XSDAnySimpleType.java:73)
> at java.lang.String.valueOf(String.java:2516)
> at org.eclipse.emf.common.util.BasicEList.toString(BasicEList.j ava:1112)
>
> Is there a better way for me to query these values or is this a bug?
> I've also seen oddities when querying the value of time related simple
> types, for example:
>
> <simpleType name="type50">
> <restriction base="gMonthDay">
> <minInclusive value="--01-31+01:00"/>
> <maxExclusive value="--02-07"/>
> </restriction>
> </simpleType>
>
> The timezone seems to be replaced with an undisplayable character such
> as the values: '--1-30Z' or '--2-7?'
>
> Is there a way that I can retrieve those values from a schema in a
> displayable way that doesn't require special logic for each data type?
>
> Thanks,
>
> Paul.
Re: XSDConstrainingFacet.getEffectiveValue().toString() [message #588083 is a reply to message #46993] Thu, 03 June 2004 16:11 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
Paul,

I'll have a look. We've recently moved the implementation of the simple types from XSD to
Ecore and upgraded to using a copy of a more current Xerces implementation...


Paul Cooper wrote:

> I've been playing with Facets on simple types and I've encountered
> exceptions being thrown when I call the toString() method on the
> effective values of certain types of facet. For example, if I call it
> for a hexBinary value in an enumeration as in the following example:
>
> <schema targetNamespace="http://com/schemas/Example"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <complexType name="CAType">
> <sequence>
> <element name="el60" type="xsd1:type60"/>
> </sequence>
> </complexType>
>
> <simpleType name="type60">
> <restriction base="hexBinary">
> <enumeration value="0FB7ff01"/>
> <enumeration value="0F56CCAABBAA"/>
> <enumeration value="CABBA9E5000000"/>
> </restriction>
> </simpleType>
> </schema>
>
> I get:
>
> java.lang.ArrayIndexOutOfBoundsException: -5
> at org.eclipse.xsd.impl.type.DataValue$HexBin.encode(DataValue. java:454)
> at
> org.eclipse.xsd.impl.type.XSDHexBinaryType.getCanonicalLiter al(XSDHexBinaryType.java:44)
> at
> org.eclipse.xsd.impl.type.XSDAnySimpleType$ByteSequence.toSt ring(XSDAnySimpleType.java:73)
> at java.lang.String.valueOf(String.java:2516)
> at org.eclipse.emf.common.util.BasicEList.toString(BasicEList.j ava:1112)
>
> Is there a better way for me to query these values or is this a bug?
> I've also seen oddities when querying the value of time related simple
> types, for example:
>
> <simpleType name="type50">
> <restriction base="gMonthDay">
> <minInclusive value="--01-31+01:00"/>
> <maxExclusive value="--02-07"/>
> </restriction>
> </simpleType>
>
> The timezone seems to be replaced with an undisplayable character such
> as the values: '--1-30Z' or '--2-7?'
>
> Is there a way that I can retrieve those values from a schema in a
> displayable way that doesn't require special logic for each data type?
>
> Thanks,
>
> Paul.


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: XSDConstrainingFacet.getEffectiveValue().toString() [message #588100 is a reply to message #46993] Thu, 03 June 2004 17:12 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33264
Registered: July 2009
Senior Member
Paul,

Now that I look more closely, I see that the stack is showing that you are using the older
implementation of the datatypes, not the newer ones that are in Ecore now. I think it's
working properly in the latest driver.


Paul Cooper wrote:

> I've been playing with Facets on simple types and I've encountered
> exceptions being thrown when I call the toString() method on the
> effective values of certain types of facet. For example, if I call it
> for a hexBinary value in an enumeration as in the following example:
>
> <schema targetNamespace="http://com/schemas/Example"
> xmlns="http://www.w3.org/2001/XMLSchema">
> <complexType name="CAType">
> <sequence>
> <element name="el60" type="xsd1:type60"/>
> </sequence>
> </complexType>
>
> <simpleType name="type60">
> <restriction base="hexBinary">
> <enumeration value="0FB7ff01"/>
> <enumeration value="0F56CCAABBAA"/>
> <enumeration value="CABBA9E5000000"/>
> </restriction>
> </simpleType>
> </schema>
>
> I get:
>
> java.lang.ArrayIndexOutOfBoundsException: -5
> at org.eclipse.xsd.impl.type.DataValue$HexBin.encode(DataValue. java:454)
> at
> org.eclipse.xsd.impl.type.XSDHexBinaryType.getCanonicalLiter al(XSDHexBinaryType.java:44)
> at
> org.eclipse.xsd.impl.type.XSDAnySimpleType$ByteSequence.toSt ring(XSDAnySimpleType.java:73)
> at java.lang.String.valueOf(String.java:2516)
> at org.eclipse.emf.common.util.BasicEList.toString(BasicEList.j ava:1112)
>
> Is there a better way for me to query these values or is this a bug?
> I've also seen oddities when querying the value of time related simple
> types, for example:
>
> <simpleType name="type50">
> <restriction base="gMonthDay">
> <minInclusive value="--01-31+01:00"/>
> <maxExclusive value="--02-07"/>
> </restriction>
> </simpleType>
>
> The timezone seems to be replaced with an undisplayable character such
> as the values: '--1-30Z' or '--2-7?'
>
> Is there a way that I can retrieve those values from a schema in a
> displayable way that doesn't require special logic for each data type?
>
> Thanks,
>
> Paul.


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:XSDConstrainingFacet.getEffectiveValue().toString()
Next Topic:XSDSimpleTypeDefinition - facets, syntheticFacets, and facetContents
Goto Forum:
  


Current Time: Thu Dec 26 10:38:16 GMT 2024

Powered by FUDForum. Page generated in 0.03314 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top