You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "Johannes Stamminger (JIRA)" <xm...@xml.apache.org> on 2005/07/06 15:43:12 UTC

[jira] Commented: (XMLBEANS-172) No accessor to text content for element without extension base definition

    [ http://issues.apache.org/jira/browse/XMLBEANS-172?page=comments#action_12315139 ] 

Johannes Stamminger commented on XMLBEANS-172:
----------------------------------------------

I just retested with 2.0 final version: definitely the sourcecode being generated is not compilable as it misses the TypeSystemHolder.java _SOURCECODE_.

Not with 2.0-beta1, nor with 2.0 final.
Not with '-scronly=true' nor without!!

This is definitely no IDE problem (btw: I'm using IntelliJ, not Eclipse).

Note: the xmlbeans-generated .jar contains a TypeSystemHolder.class file.

The annoying thing is: when creating the .jar with xmlbeans itself (only way working so far) I do not have full control about javac options used.

And IMHO this is no minor bug when creating not compilable sourcecode, please re-consider this.

> No accessor to text content for element without extension base definition
> -------------------------------------------------------------------------
>
>          Key: XMLBEANS-172
>          URL: http://issues.apache.org/jira/browse/XMLBEANS-172
>      Project: XMLBeans
>         Type: Bug
>   Components: Compiler
>     Versions: Version 2, Version 2 Beta 1
>  Environment: Observed for schema attached to XMLBEANS-120 http://issues.apache.org/jira/secure/attachment/12310698/SpaceSystem.xsd with XMLBeans 2.0.0-beta1 and 2.0.0 final.
>     Reporter: Johannes Stamminger

>
> In the mentioned schema there is defined the type UnitType like:
> ...
> <complexType name="UnitType" mixed="true">
>   <annotation>
>     <documentation>Used to hold the unit(s) plus possibly the exponents for the units</documentation>
>   </annotation>
>   <attribute name="power" type="decimal" use="optional" default="1"/>
>   <attribute name="factor" type="string" default="1"/>
>   <attribute name="description" type="string"/>
> </complexType>
> ...
> IMHO for an Unit element being of type UnitType it is allowed to set a nested text like <Unit>m</Unit> (at least having a document with such a definition is validated successfully).
> But the XMLBeans generated API does not provide an access to that one, I'm not able to set/get the text value from the generated UnitType class as it derives from XmlObject.
> Only way so far to get accessors (set/getStringValue()) is by changing the schema to define the extension base:
> ...
> <complexType name="UnitType" mixed="true">
>   <annotation>
>     <documentation>Used to hold the unit(s) plus possibly the exponents for the units</documentation>
>   </annotation>
>   <simpleContent>
>     <extension base = "string">
>       <attribute name="power" type="decimal" use="optional" default="1"/>
>       <attribute name="factor" type="string" default="1"/>
>       <attribute name="description" type="string"/>
>     </extension>
>   </simpleContent>
> </complexType>
> ...
> That way the UnitType class now derives from XmlString.
> Removing the unnecessary (as there are no nested elements defined) mixed="true" is not sufficient, still not accessors.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@xmlbeans.apache.org
For additional commands, e-mail: dev-help@xmlbeans.apache.org