[
Lists Home |
Date Index |
Thread Index
]
> > 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.
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.
/r$
--
Rich Salz Chief Security Architect
DataPower Technology http://www.datapower.com
XS40 XML Security Gateway http://www.datapower.com/products/xs40.html
XML Security Overview http://www.datapower.com/xmldev/xmlsecurity.html
|