standalone macros?

I’ve been playing around with implementing a web app for CSL files
using Django.

Building on previous ideas, I’m thinking about modifying the CSL
schema to allow standalone macro files. The immediate practical issue
is that Django has an XMLField model type that allows you to tie the
field to an RNG schema. So, e.g., think a macro table row, where the
validated XML is embedded.

The only two issues I can see that might cause problems are:

  1. how to maintain a global context (more than the local name attribute)?

  2. how to deal with macro dependencies?

The two are of course related.

1 seems easy enough, and that is to allow an optional base URI
attribute on cs:macro.

2 might be more tricky. I can’t see an elegant way to reference macros
globally without adding needless complexity, unless we were to allow a
URI as the target of a macro attribute.

Any thoughts? Or should I just drop this idea, and maybe create a
customization schema that is only designed to validate the macros (so
that they only stand alone within the database)?

Bruce