[xsd-users] customising XSD to use ICU

Bradley Beddoes beddoes at intient.com
Mon Jan 8 01:56:33 EST 2007


Hi all,
At the moment I am attempting to customize XSD generated output to take 
advantage of the ICU library from (http://icu.sourceforge.net) to ensure 
we have true unicode support cross platform and aren't relying on the 
terrible wchar_t.

In particular at the moment I am redefining xsd:string to be represented 
by UnicodeString ( 
http://icu.sourceforge.net/apiref/icu4c/classUnicodeString.html ), I may 
look at UDate amongst others as well.

All has gone well so far until I got to enum and xsd:lang. Both of these 
seem to be causing me a fair deal of grief.

Firstly xml:lang as it seems simple enough, I can't seem to work out how 
to customize that type "--custom-type lang" does not seem to provide 
anything in my generated header at all, it seems to be generated as a 
struct internally to for example localizedURIType in the below schema. 
That in itself is not a problem but it generates constructors which take 
values of hard coded basic_string<char> instead of what I need which is 
xml_schema::string, any ideas how to fix this?

     <complexType name="localizedURIType">
         <simpleContent>
             <extension base="anyURI">
                 <attribute ref="xml:lang" use="required"/>
             </extension>
         </simpleContent>
     </complexType>

We regards to enums these appear to have the same constructor problem as 
noted about (use of basic_string<char>). Additionally I seem to be 
missing a non equivalence operator and I can't seem to figure out 
exactly what I need to implement (UnicodeString defines this method so 
its not that).

I have attached my generated header files

-- 
Bradley Beddoes
Lead Software Architect

Intient - "Open Source, Open Standards"




More information about the xsd-users mailing list