Hi Bryan,

Castor by default will use lower-case with hyphens, but that only happens if introspection takes place on class. If you generate source code, Castor will use whatever names you have specified in the schema since it assumes you of course want your element names to match the schema file.

If you just want to use the source generator to create your class files, but don't really care too much about the element names, you might want to try disabling the descriptor generation using the -nodesc option. This will prevent descriptor generation and cause Castor to introspect your classes. Keep in mind that not all Castor generated source code can easily be introspected since the source generator takes advantage of writing special handlers on occasion, so you'll have to try it out first.

--Keith

Bryan LaPlante wrote:
Ok, someone save me from myself. lower is the default property for
org.exolab.castor.xml.naming and I have several objects that get output as a
hyphenated tag names when they are two syllables. What could I have done
when I generated my latest classes to have caused castor to think I want the
tags to come out ProperCase style. Here is my xsd that I used to generate
the classes. Do I need to put hyphens in the element name?

<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
    <xsd:element name="SampleTag">
        <xsd:complexType>
            <xsd:sequence>
                <xsd:element maxOccurs="unbounded" minOccurs="0"
ref="SampleNestedTag"/>
            </xsd:sequence>
            <xsd:attribute name="id" type="xsd:string" use="optional"/>
        </xsd:complexType>
    </xsd:element>
    <xsd:element name="SampleNestedTag">
        <xsd:complexType>
            <xsd:attribute name="id" type="xsd:string" use="optional"/>
        </xsd:complexType>
    </xsd:element>
</xsd:schema>

----- Original Message -----
From: "Bryan LaPlante" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, September 12, 2005 9:37 PM
Subject: Re: [castor-user] about hyphenated tag names



Never mind, I found it in castor.properties
org.exolab.castor.xml.naming=lower

----- Original Message -----
From: "Bryan LaPlante" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, September 12, 2005 9:11 PM
Subject: Re: [castor-user] about hyphenated tag names



I should also say that I have no idea ahead of time what the name of the
class will created by a 3rd party user.

Thanks

----- Original Message -----
From: "Bryan LaPlante" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Monday, September 12, 2005 9:09 PM
Subject: [castor-user] about hyphenated tag names



I am not sure how to word this for the archive-search to turn up any
results. Is there a way to set the marshaller to output tags with

proper

case names with a hyphen instead of <SomeName> when the class is named
SomeName?

Thanks

Bryan LaPlante



-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------





-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------





-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------






-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------




-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to