[ https://issues.apache.org/jira/browse/XMLBEANS-83?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13081017#comment-13081017 ]
Robert Liguori commented on XMLBEANS-83: ---------------------------------------- Just FYI... Here is the 'email' that Paul mentioned: http://mail-archives.apache.org/mod_mbox/xmlbeans-dev/200411.mbox/%3C418BA2BF.361.1F40441@localhost%3E > Suggested changes to scomp > -------------------------- > > Key: XMLBEANS-83 > URL: https://issues.apache.org/jira/browse/XMLBEANS-83 > Project: XMLBeans > Issue Type: New Feature > Components: Compiler > Affects Versions: unspecified > Reporter: Paul Adams > Assignee: Radu Preotiuc-Pietro > Priority: Minor > Fix For: TBD > > > Hi, > I posted to the dev forum a suggested change to scomp to produce a mapping of > the XML schema names to the produced XmlBeans java name in xsdconfig format. > The email on 5th November, titled "Suggested change to scomp", and contains > an attachment with a copy of the amendments to scomp. I suggested that scomp > be amended to have a new option -javaname followed by the file name to send > the output to. > To summarise the email we needed a way of producing a list of the XML schema > names to the XmlBeans java name, for cases when the mapping was non obvious > illustrated below: > A simple schema with a global element of: > purchase-order (set as a global element) > Customer-name (set a a complex type) > name (set as a simple type, say xs:string) > causes XmlBeans to create the following: > PurchaseOrderDocument class > Method names in the class: > getPurchaseOrder method returning inner class PurhaseOrder > PurchaseOrder inner class > getCustomerName returning class CustomerName > CustomerName class > Method names in the class: > getName returns simple type for xml item 'name' of XmlString > Because of the name translation performed by XMLBeans on the schema's XML > names in producing the Java names we needed a method of producing a list of > what we have termed non-obvious names produced by the translation. This would > display the translation for instances such as Customer-name above which is > translated to CustomerName, but more importantly, instances where XMLBeans > has to make the Java name unique by adding a digit to the resulting name (if > say the schema had Customer-name and CustomerName). This list can then be > used to look up the javaname to use when referencing an Xml name. > The file is produced in an xsdconfig compatible file format. This file can > then be used to look up the name or even remap the names produced if required. > Here's a couple of lines of the output > <!-- pathname=/eas:purchase-order/eas:Customer/eas:customer--> > <xb:qname name="eas:customer" javaname="Customer"/> > before the mapping is a comment showing the location of the element being > mapped and following it is the xsdconfig syntax to perform the mapping. This > would then allow the name to be remapped if desired by putting the .xsdconfig > file back through scomp. > So to produce the mapping to easypod.xsdconfig from easypod.xsd the change > would use: > scomp -compiler c:\j2sdk1.4.2_06\bin\javac.exe -jar > c:\j2sdk1.4.2_06\bin\jar.exe -javamaps easypod.xsdconfig easypod.xsd > Paul Adams -- This message is automatically generated by JIRA. For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@xmlbeans.apache.org For additional commands, e-mail: dev-h...@xmlbeans.apache.org