[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xmlbeans-dev
Subject:    [jira] Updated: (XMLBEANS-83) Suggested changes to scomp
From:       "Radu Preotiuc-Pietro (JIRA)" <xmlbeans-dev () xml ! apache ! org>
Date:       2005-04-25 23:25:51
Message-ID: 2068548977.1114471551733.JavaMail.jira () ajax ! apache ! org
[Download RAW message or body]

     [ http://issues.apache.org/jira/browse/XMLBEANS-83?page=all ]

Radu Preotiuc-Pietro updated XMLBEANS-83:
-----------------------------------------

    Fix Version: TBD

> Suggested changes to scomp
> --------------------------
> 
> Key: XMLBEANS-83
> URL: http://issues.apache.org/jira/browse/XMLBEANS-83
> Project: XMLBeans
> Type: New Feature
> Components: Compiler
> 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.
-
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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic