Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » XSDConstrainingFacet.getEffectiveValue().toString()
XSDConstrainingFacet.getEffectiveValue().toString() [message #588072] Thu, 03 June 2004 15:59
Paul Cooper is currently offline Paul CooperFriend
Messages: 11
Registered: July 2009
Junior Member
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.
Previous Topic:maxLength not permitted in string
Next Topic:XSDConstrainingFacet.getEffectiveValue().toString()
Goto Forum:
  


Current Time: Sat Dec 20 16:02:51 GMT 2014

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

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