You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xmlbeans.apache.org by "David Pytel (JIRA)" <xm...@xml.apache.org> on 2008/09/05 17:32:44 UTC

[jira] Created: (XMLBEANS-381) Generated source files for nested simple enumeration type does not compile - "cannot find symbol org.apache.xmlbeans.XmlString.Enum"

Generated source files for nested simple enumeration type does not compile - "cannot find symbol org.apache.xmlbeans.XmlString.Enum"
------------------------------------------------------------------------------------------------------------------------------------

                 Key: XMLBEANS-381
                 URL: https://issues.apache.org/jira/browse/XMLBEANS-381
             Project: XMLBeans
          Issue Type: Bug
          Components: Binding
    Affects Versions: TBD
         Environment: Any
            Reporter: David Pytel
            Priority: Minor


Generated source files for xsd below does not compile:

***************************************************
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<xsd:simpleType name="someAttributeType">
		<xsd:restriction>
			<xsd:simpleType>
				<xsd:restriction base="xsd:string">
					<xsd:enumeration value="aaaaa" />
					<xsd:enumeration value="bbbbb" />
					<xsd:enumeration value="ccccc" />
					<xsd:enumeration value="ddddd" />
					<xsd:enumeration value="eeeee" />
				</xsd:restriction>
			</xsd:simpleType>
		</xsd:restriction>
	</xsd:simpleType>
	<xsd:complexType name="SomeComplexType">
		<xsd:attribute name="attr" type="someAttributeType"/>
	</xsd:complexType>
</xsd:schema>
***************************************************

Compilation error message:
***************************************************
C:\projects\workspace-opensource\TestsForXmlBeansBugs\.\srcgen\noNamespace\SomeComplexType.java:24: cannot find symbol
symbol  : class Enum
location: interface org.apache.xmlbeans.XmlString
    org.apache.xmlbeans.XmlString.Enum getAttr();
.... and so on
***************************************************

Xsd file is valid according to http://www.w3.org/2001/03/webdata/xsv validator.
One may ask if it makes sense - unfortunately I must work with a schema with similiar constructs:
http://crd.gov.pl/xml/schematy/adres/2008/05/09/adres.xsd

This problem occurs in xmlbeans 2.4.0 (there is no such a version to choose when creating bug so I've chosen TBD) and current trunk from svn repo.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


RE: best way to uniquely identify a remote XmlObject?

Posted by Radu Preotiuc-Pietro <ra...@oracle.com>.
That's an interesting problem. XMLBeans doesn't have anything off the shelf to do this, of course,  but I have been thinking about how best to accomplish this using the tools that XMLBeans does have. I think you have already explored these avenues but let me give you some additional thoughts because I think you need to clarify your requirements.
 
1. If you need a form of identification that survives save/reload, then XPath to the XmlObject is a good solution, but it does assume that while in the "saved" form, the document is not changed.
 
2. If you need a way to "mark" an XmlObject while working with the document in which it is contained, then XmlBookmarks are there for this exact purpose. However, since bookmarks don't have an XML representation, they will be lost after save/reload.
 
3. If you have "write access" to the XmlSchema that backs your documents, then it's simple, you just add an "id" attribute to the type of the XmlObjects that you are interested in tracking - problem solved (something makes me think though that you can't really modify your Schema/saved documents).
 
4. You can combine 1. and 2. as long as all modifications happen while the XmlObject is in-memory. If modifications can happen while the document is in the "saved" form (outside of your control), then I will have to say that the problem is ill-defined: if you had two <foo> elements and a pointer to the second when you saved the document, but when you load you see three <foo>'s, how do you know if another <foo> was inserted in the second position, pushing the <foo> that you're interested in third, or the extra <foo> was inserted in the third position, leaving the one you are interested in second? Maybe saving hashes of the elements that you are interested in would help here, to verify whether they were changed by some other process or not.
 
Hope this helps,
Radu


________________________________

	From: Anthony Fryer [mailto:apfryer@hotmail.com] 
	Sent: Wednesday, September 17, 2008 11:07 PM
	To: dev@xmlbeans.apache.org
	Subject: best way to uniquely identify a remote XmlObject?
	
	
	I was wondering if what is the best way to uniquely identify an XmlObject within a document on a remote server?  I need something similar in concept to the signature of a SchemaType which allows me to use SchemaTypeSystem.typeForSignature to retrieve the SchemaType object. 
	 
	I have up to now been generating the  XPath to the XmlObject to identify it, but am realizing that this breaks easily when peer nodes or parent peer nodes are deleted or inserted, changing the path to the XmlObject.  
	 
	Are bookmarks what I should use for this?  Do bookmarks persist if a document is reloaded?  Is there some other better way I can do this?
	 
	Regards,
	 
	Anthony Fryer
	
	
________________________________

	Sell your car for just $40 at CarPoint.com.au It's simple! <http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT> 


best way to uniquely identify a remote XmlObject?

Posted by Anthony Fryer <ap...@hotmail.com>.
I was wondering if what is the best way to uniquely identify an XmlObject within a document on a remote server?  I need something similar in concept to the signature of a SchemaType which allows me to use SchemaTypeSystem.typeForSignature to retrieve the SchemaType object. 
 
I have up to now been generating the  XPath to the XmlObject to identify it, but am realizing that this breaks easily when peer nodes or parent peer nodes are deleted or inserted, changing the path to the XmlObject.  
 
Are bookmarks what I should use for this?  Do bookmarks persist if a document is reloaded?  Is there some other better way I can do this?
 
Regards,
 
Anthony Fryer
_________________________________________________________________
It's simple! Sell your car for just $40 at CarPoint.com.au
http://a.ninemsn.com.au/b.aspx?URL=http%3A%2F%2Fsecure%2Dau%2Eimrworldwide%2Ecom%2Fcgi%2Dbin%2Fa%2Fci%5F450304%2Fet%5F2%2Fcg%5F801459%2Fpi%5F1004813%2Fai%5F859641&_t=762955845&_r=tig_OCT07&_m=EXT

[jira] Resolved: (XMLBEANS-381) Generated source files for nested simple enumeration type does not compile - "cannot find symbol org.apache.xmlbeans.XmlString.Enum"

Posted by "Radu Preotiuc-Pietro (JIRA)" <xm...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XMLBEANS-381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Radu Preotiuc-Pietro resolved XMLBEANS-381.
-------------------------------------------

       Resolution: Fixed
    Fix Version/s: Version 2.4.1 

Patch commited (revision 722721). Thanks, David!

> Generated source files for nested simple enumeration type does not compile - "cannot find symbol org.apache.xmlbeans.XmlString.Enum"
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: XMLBEANS-381
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-381
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Binding
>    Affects Versions: TBD
>         Environment: Any
>            Reporter: David Pytel
>            Priority: Minor
>             Fix For: Version 2.4.1 
>
>         Attachments: patch_for_XMLBEANS-381.patch
>
>
> Generated source files for xsd below does not compile:
> ***************************************************
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<xsd:simpleType name="someAttributeType">
> 		<xsd:restriction>
> 			<xsd:simpleType>
> 				<xsd:restriction base="xsd:string">
> 					<xsd:enumeration value="aaaaa" />
> 					<xsd:enumeration value="bbbbb" />
> 					<xsd:enumeration value="ccccc" />
> 					<xsd:enumeration value="ddddd" />
> 					<xsd:enumeration value="eeeee" />
> 				</xsd:restriction>
> 			</xsd:simpleType>
> 		</xsd:restriction>
> 	</xsd:simpleType>
> 	<xsd:complexType name="SomeComplexType">
> 		<xsd:attribute name="attr" type="someAttributeType"/>
> 	</xsd:complexType>
> </xsd:schema>
> ***************************************************
> Compilation error message:
> ***************************************************
> C:\projects\workspace-opensource\TestsForXmlBeansBugs\.\srcgen\noNamespace\SomeComplexType.java:24: cannot find symbol
> symbol  : class Enum
> location: interface org.apache.xmlbeans.XmlString
>     org.apache.xmlbeans.XmlString.Enum getAttr();
> .... and so on
> ***************************************************
> Xsd file is valid according to http://www.w3.org/2001/03/webdata/xsv validator.
> One may ask if it makes sense - unfortunately I must work with a schema with similiar constructs:
> http://crd.gov.pl/xml/schematy/adres/2008/05/09/adres.xsd
> This problem occurs in xmlbeans 2.4.0 (there is no such a version to choose when creating bug so I've chosen TBD) and current trunk from svn repo.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (XMLBEANS-381) Generated source files for nested simple enumeration type does not compile - "cannot find symbol org.apache.xmlbeans.XmlString.Enum"

Posted by "David Pytel (JIRA)" <xm...@xml.apache.org>.
    [ https://issues.apache.org/jira/browse/XMLBEANS-381?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12628657#action_12628657 ] 

David Pytel commented on XMLBEANS-381:
--------------------------------------

Proposed patch extracts from printStringEnumeration method code that checks if type has a enum base type to seperate method. Then using this hasBase(..) method, the appropriate type is chosen in javaTypeForProperty method.

> Generated source files for nested simple enumeration type does not compile - "cannot find symbol org.apache.xmlbeans.XmlString.Enum"
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: XMLBEANS-381
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-381
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Binding
>    Affects Versions: TBD
>         Environment: Any
>            Reporter: David Pytel
>            Priority: Minor
>         Attachments: patch_for_XMLBEANS-381.patch
>
>
> Generated source files for xsd below does not compile:
> ***************************************************
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<xsd:simpleType name="someAttributeType">
> 		<xsd:restriction>
> 			<xsd:simpleType>
> 				<xsd:restriction base="xsd:string">
> 					<xsd:enumeration value="aaaaa" />
> 					<xsd:enumeration value="bbbbb" />
> 					<xsd:enumeration value="ccccc" />
> 					<xsd:enumeration value="ddddd" />
> 					<xsd:enumeration value="eeeee" />
> 				</xsd:restriction>
> 			</xsd:simpleType>
> 		</xsd:restriction>
> 	</xsd:simpleType>
> 	<xsd:complexType name="SomeComplexType">
> 		<xsd:attribute name="attr" type="someAttributeType"/>
> 	</xsd:complexType>
> </xsd:schema>
> ***************************************************
> Compilation error message:
> ***************************************************
> C:\projects\workspace-opensource\TestsForXmlBeansBugs\.\srcgen\noNamespace\SomeComplexType.java:24: cannot find symbol
> symbol  : class Enum
> location: interface org.apache.xmlbeans.XmlString
>     org.apache.xmlbeans.XmlString.Enum getAttr();
> .... and so on
> ***************************************************
> Xsd file is valid according to http://www.w3.org/2001/03/webdata/xsv validator.
> One may ask if it makes sense - unfortunately I must work with a schema with similiar constructs:
> http://crd.gov.pl/xml/schematy/adres/2008/05/09/adres.xsd
> This problem occurs in xmlbeans 2.4.0 (there is no such a version to choose when creating bug so I've chosen TBD) and current trunk from svn repo.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (XMLBEANS-381) Generated source files for nested simple enumeration type does not compile - "cannot find symbol org.apache.xmlbeans.XmlString.Enum"

Posted by "David Pytel (JIRA)" <xm...@xml.apache.org>.
     [ https://issues.apache.org/jira/browse/XMLBEANS-381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

David Pytel updated XMLBEANS-381:
---------------------------------

    Attachment: patch_for_XMLBEANS-381.patch

Proposed patch.

> Generated source files for nested simple enumeration type does not compile - "cannot find symbol org.apache.xmlbeans.XmlString.Enum"
> ------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: XMLBEANS-381
>                 URL: https://issues.apache.org/jira/browse/XMLBEANS-381
>             Project: XMLBeans
>          Issue Type: Bug
>          Components: Binding
>    Affects Versions: TBD
>         Environment: Any
>            Reporter: David Pytel
>            Priority: Minor
>         Attachments: patch_for_XMLBEANS-381.patch
>
>
> Generated source files for xsd below does not compile:
> ***************************************************
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<xsd:simpleType name="someAttributeType">
> 		<xsd:restriction>
> 			<xsd:simpleType>
> 				<xsd:restriction base="xsd:string">
> 					<xsd:enumeration value="aaaaa" />
> 					<xsd:enumeration value="bbbbb" />
> 					<xsd:enumeration value="ccccc" />
> 					<xsd:enumeration value="ddddd" />
> 					<xsd:enumeration value="eeeee" />
> 				</xsd:restriction>
> 			</xsd:simpleType>
> 		</xsd:restriction>
> 	</xsd:simpleType>
> 	<xsd:complexType name="SomeComplexType">
> 		<xsd:attribute name="attr" type="someAttributeType"/>
> 	</xsd:complexType>
> </xsd:schema>
> ***************************************************
> Compilation error message:
> ***************************************************
> C:\projects\workspace-opensource\TestsForXmlBeansBugs\.\srcgen\noNamespace\SomeComplexType.java:24: cannot find symbol
> symbol  : class Enum
> location: interface org.apache.xmlbeans.XmlString
>     org.apache.xmlbeans.XmlString.Enum getAttr();
> .... and so on
> ***************************************************
> Xsd file is valid according to http://www.w3.org/2001/03/webdata/xsv validator.
> One may ask if it makes sense - unfortunately I must work with a schema with similiar constructs:
> http://crd.gov.pl/xml/schematy/adres/2008/05/09/adres.xsd
> This problem occurs in xmlbeans 2.4.0 (there is no such a version to choose when creating bug so I've chosen TBD) and current trunk from svn repo.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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