Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » XML Schema Definition (XSD) » Proper way to get the default value for an attribute
Proper way to get the default value for an attribute [message #602630] Fri, 28 September 2007 14:27
Richard Gregory is currently offline Richard GregoryFriend
Messages: 13
Registered: July 2009
Junior Member

I have this code to get the default value that works fine for an


However, when I call get XSDAttributeDeclaration.getLexicalValue(), it
always returns null, for example with this XSD:

<xsd:complexType name="HasDefault">
<xsd:element minOccurs="0" name="field1" type="xsd:string"
default="some default value" />
<xsd:attribute name="attr" type="xsd:int" default="123"/>

I see from introspecting the XSDAttributeDeclaration at runtime that the
default value is in XSDAttributeDeclaration.eContainer.lexicalValue and
in .value, where eContainer is an XSDAttributeUse.

So I can write code to get it from there, but is that the right way? I
would expect a more direct way.


Previous Topic:idrefs and holders
Next Topic:Proper way to get the default value for an attribute
Goto Forum:

Current Time: Tue Apr 24 05:08:24 GMT 2018

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

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