Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

xs: element type for char?

 
Saathvik Reddy
Ranch Hand
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1294
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 228
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Marco,

Thanks for the clarification.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic