[xsd-users] customising XSD to use ICU

Boris Kolpackov boris at codesynthesis.com
Mon Jan 8 15:31:41 EST 2007


Hi Bradley,

Bradley Beddoes <beddoes at intient.com> writes:

> There is a pretty good list of stuff I am looking to avoid here:
> http://icu.sourceforge.net/userguide/posix.html

Thanks for pointing this to me, I will take a look.


> >The problem with enums is that they use std::basic_string internally
> >as well as an array of string literals for enumerators. The only way
> >to overcome this (without using one of the strategies outlines above)
> >is to completely customize every string-based enum.
>
> I'll have a look into this in more depth, manually at first as I only
> have about 4 small enums at present but it may be worthwhile me
> investigating putting that support into the schema compilation process.
> Would you be interested in a patch?

Sure, if you can come up with something clean. It won't be easy though.
The only way to provide string literals for non-char/wchar_t strings is
by manually creating an array of symbols, e.g.,

utf16_t hello[] = {'h', 'e', 'l', 'l', 'o', '\0'};

I think it will be much easier and cleaner to use say char/UTF-8 inside
the runtime for things like enum literals, element/attribute names, etc.
especially since they will hardly ever be outside ASCII.


BTW, when you manage to make everything work, perhaps you could create
a short Wiki write-up of the steps one needs to take to make the
generated code use ICU UnicodeString for xml_schema::string:

http://wiki.codesynthesis.com/

Or simply post the instructions to the mailing list and I will transfer
them to the Wiki. I would really appreciate it.


-boris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 652 bytes
Desc: Digital signature
Url : http://codesynthesis.com/pipermail/xsd-users/attachments/20070108/52a482b8/attachment.pgp


More information about the xsd-users mailing list