xml - Using XS:date i want date in format YYYYMMDD -
using xsd want accept date of format yyyymmdd in xml field .. how can
i saw in example work ??
xml schema defines datetime
iso8601 exceptions , should stick this, otherwise serious interoperability issues. if want send/receive date using different format, use simpletype
regular expression restriction , parse/format date in application code:
<xs:simpletype name="customdate"> <xs:restriction base="xs:string"> <xs:pattern value="\d{8}"/> </xs:restriction> </xs:simpletype>
if really want mess around built-in types (highly inadvisable), xml framework/library might have support that. instance in java/jaxb can apply custom transformers/formatters type, in client/server code still using date
object (not 8-digit string
), marshalled/unmarshalled using custom routine.
Comments
Post a Comment