[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Refreshed genx.h, plus some plans
----- Original Message ----- From: "Rich Salz" <rsalz@d...> To: "Karl Waclawek" <karl@w...> > > > int genxDeclareNamespace(genxWriter w, utf8Byte * uri, utf8Byte * > > > prefix); > > > > > > if prefix == NULL then genx will generate one. prefix == "" is not > > > allowed. > > > > What about default namespaces? > > I'd do this. Add this to your header: > extern char genxDEFAULT_NAMESPACE[1]; > and this to your implementation: > char genxDEFAULT_NAMESPACE[1] = { 0 }; > and then users do > int genxDeclareNamespace(w, "urn:foo:bar", genxDEFAULT_NAMESPACE); > And then you do a pointer comparison to see if users passed in default. To be somewhat symmetric one could define a NULL constant called genxAUTO_PREFIX. > BTW, the API doesn't have const-correctness yet. > /r$ > > > Maybe NULL should mean "default namespace", and you add a second function: > > > > int genxDeclareAutoNamespace(genxWriter w, utf8Byte * uri); > > > > which auto-generates a prefix. > > Again, a new "pointer constant" will remove the need for a new function. > That in itself would not bother me much - there are already three functions just for passing character data. Although it is more of a problem in C, while in other languages you can overload a function name. Karl
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|