This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes xs: element type for char? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xs: element type for char?" Watch "xs: element type for char?" New topic
Author

xs: element type for char?

Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Hi,

I am trying to write a xsd(schema definition). I have a element which should be of char type. What would be the xs:element type?

<xs:element name="action" type="xs:string" />

Should i use the string to map to char or does xsd have anything special for char

Thanks,
Srikanth.
Marco Ehrentreich
best scout
Bartender

Joined: Mar 07, 2007
Posts: 1280

Hi Srikanth,

here's a list of the built-in XML schema types.

There's no special type for single characters so you will have to map it to a string and deal with it in Java or you could create an user defined simple type which restricts the string type for example by using a regular expression for a single character.

Marco
Saathvik Reddy
Ranch Hand

Joined: Jun 03, 2005
Posts: 228
Marco,

Thanks for the clarification.
 
Consider Paul's rocket mass heater.
 
subject: xs: element type for char?
 
Similar Threads
specify root for xsd validation
Help me for xsd creation
XSD generation Issue
XMl schema