Value validation [message #47445] |
Tue, 08 June 2004 06:59  |
Eclipse User |
|
|
|
Originally posted by: invalid.soft-gems.net
Ed,
Is there a built-in facility to check whether a given value is valid
compared to the effective facets of its type? I can write this myself, but
I would suspect that this is an often needed feature when working with
schemas, so it would be cool if there is already an implementation.
Mike
--
www.soft-gems.net
|
|
|
|
|
|
|
|
Re: Value validation [message #47651 is a reply to message #47622] |
Wed, 09 June 2004 04:33  |
Eclipse User |
|
|
|
Originally posted by: invalid.soft-gems.net
Ed,
> XSDFeature.getValue will return the default value of an
XSDElementDeclaration or
> an XSDAttributeDeclaration. This is an XML Schema infoset property. It is
> computed from XSDFeature.getLexicalValue, which is the string literal
default as
> it appears in the schema.
Thank you.
Mike
--
www.soft-gems.net
|
|
|
Re: Value validation [message #588272 is a reply to message #47445] |
Tue, 08 June 2004 07:24  |
Eclipse User |
|
|
|
Mike,
To determine if a literal is valid with respect to a simple type, you can use
either XSDSimpleTypeDefinition.isValidLiteral or
XSDSimpleTypeDefinition.assess.
Mike Lischke wrote:
> Ed,
>
> Is there a built-in facility to check whether a given value is valid
> compared to the effective facets of its type? I can write this myself, but
> I would suspect that this is an often needed feature when working with
> schemas, so it would be cool if there is already an implementation.
>
> Mike
> --
> www.soft-gems.net
|
|
|
Re: Value validation [message #589115 is a reply to message #47505] |
Tue, 08 June 2004 10:19  |
Eclipse User |
|
|
|
Ed Merks wrote:
> To determine if a literal is valid with respect to a simple type, you can use
> either XSDSimpleTypeDefinition.isValidLiteral or
> XSDSimpleTypeDefinition.assess.
Works exactly as I wanted it (except for localisation of the error
message, but this is subordinated, currently). Thanks a bunch Ed.
Mike
--
www.soft-gems.net
|
|
|
Re: Value validation [message #589128 is a reply to message #47535] |
Tue, 08 June 2004 10:55  |
Eclipse User |
|
|
|
Mike,
The translation is done at the end of the development cycle. IBM pays for it (and
it's not cheap!) and then donates it to Eclipse. For standalone support, we create
the xsd.resources.jar based on the donation from IBM, so that currently contains
the translation from the 1.1.1.1 release. Unzipping that file and copying the
*.properties file to where the English plugin.properties file is should get you
translation for what was translated before...
Mike Lischke wrote:
> Ed Merks wrote:
>
> > To determine if a literal is valid with respect to a simple type, you can use
> > either XSDSimpleTypeDefinition.isValidLiteral or
> > XSDSimpleTypeDefinition.assess.
>
> Works exactly as I wanted it (except for localisation of the error
> message, but this is subordinated, currently). Thanks a bunch Ed.
>
> Mike
> --
> www.soft-gems.net
|
|
|
Re: Value validation [message #589139 is a reply to message #47569] |
Tue, 08 June 2004 10:56  |
Eclipse User |
|
|
|
Ed Merks wrote:
> Mike,
> The translation is done at the end of the development cycle. IBM pays for
it (and
> it's not cheap!) and then donates it to Eclipse. For standalone support, we
create
> the xsd.resources.jar based on the donation from IBM, so that currently
contains
> the translation from the 1.1.1.1 release. Unzipping that file and copying
the
> *.properties file to where the English plugin.properties file is should get
you
> translation for what was translated before...
This is excellent news Ed. We were thinking of doing this (at least
partially) ourselves but this way is much better :-)
A last question for today: How would I go to get an assigned default value
for an attribute if there is one? I could not find anything related to
"default" in XSDSimpleTypeDefinition interface.
Mike
--
www.soft-gems.net
|
|
|
Re: Value validation [message #589147 is a reply to message #47593] |
Tue, 08 June 2004 11:09  |
Eclipse User |
|
|
|
Mike,
XSDFeature.getValue will return the default value of an XSDElementDeclaration or
an XSDAttributeDeclaration. This is an XML Schema infoset property. It is
computed from XSDFeature.getLexicalValue, which is the string literal default as
it appears in the schema.
Mike Lischke wrote:
> Ed Merks wrote:
>
> > Mike,
>
> > The translation is done at the end of the development cycle. IBM pays for
> it (and
> > it's not cheap!) and then donates it to Eclipse. For standalone support, we
> create
> > the xsd.resources.jar based on the donation from IBM, so that currently
> contains
> > the translation from the 1.1.1.1 release. Unzipping that file and copying
> the
> > *.properties file to where the English plugin.properties file is should get
> you
> > translation for what was translated before...
>
> This is excellent news Ed. We were thinking of doing this (at least
> partially) ourselves but this way is much better :-)
>
> A last question for today: How would I go to get an assigned default value
> for an attribute if there is one? I could not find anything related to
> "default" in XSDSimpleTypeDefinition interface.
>
> Mike
> --
> www.soft-gems.net
|
|
|
Re: Value validation [message #589157 is a reply to message #47622] |
Wed, 09 June 2004 04:33  |
Eclipse User |
|
|
|
Ed,
> XSDFeature.getValue will return the default value of an
XSDElementDeclaration or
> an XSDAttributeDeclaration. This is an XML Schema infoset property. It is
> computed from XSDFeature.getLexicalValue, which is the string literal
default as
> it appears in the schema.
Thank you.
Mike
--
www.soft-gems.net
|
|
|
Powered by
FUDForum. Page generated in 0.07158 seconds