Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Value validation
Value validation [message #47445] Tue, 08 June 2004 10:59 Go to next message
Eclipse UserFriend
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 #47505 is a reply to message #47445] Tue, 08 June 2004 11:24 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

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 #47535 is a reply to message #47505] Tue, 08 June 2004 14:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: invalid.soft-gems.net

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 #47569 is a reply to message #47535] Tue, 08 June 2004 14:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

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 #47593 is a reply to message #47569] Tue, 08 June 2004 14:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: invalid.soft-gems.net

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 #47622 is a reply to message #47593] Tue, 08 June 2004 15:09 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

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 #47651 is a reply to message #47622] Wed, 09 June 2004 08:33 Go to previous message
Eclipse UserFriend
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 11:24 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31562
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Value validation [message #589115 is a reply to message #47505] Tue, 08 June 2004 14:19 Go to previous message
Mike Lischke is currently offline Mike LischkeFriend
Messages: 78
Registered: July 2009
Member
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 14:55 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31562
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Value validation [message #589139 is a reply to message #47569] Tue, 08 June 2004 14:56 Go to previous message
Mike Lischke is currently offline Mike LischkeFriend
Messages: 78
Registered: July 2009
Member
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 15:09 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 31562
Registered: July 2009
Senior Member
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


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Value validation [message #589157 is a reply to message #47622] Wed, 09 June 2004 08:33 Go to previous message
Mike Lischke is currently offline Mike LischkeFriend
Messages: 78
Registered: July 2009
Member
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
Previous Topic:Schema standard types
Next Topic:Bug in substituitionGroupAffiliation?
Goto Forum:
  


Current Time: Sat Oct 31 05:25:06 GMT 2020

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

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

Back to the top