Citation Style Language

Convert CSL schema to xsd

In my search for the best CSL editor I’ve tried to convert the rnc-schema to xsd, but no success so far.

I have tried this:

  1. Merge with jing
  2. convert with trang
jing -s csl.rnc > csl-temp.rnc" 
trang csl-temp.rnc csl.xsd

Here I’ll end up with an syntax error message (“csl/csl-temp.rnc:1:1: error: syntax error”).

Next try: Convert in one step:

trang csl.rnc csl.xsd

Here, I’ll end up with “csl.rnc:619:8: warning: choice between attributes and children cannot be represented; approximating”
If I use this to validate a style in VS Code it says “Cannot find the declaration of element ‘style’”

Any ideas?

Sorry I missed this earlier.

Why are you wanting to convert it?

RNG is a richer language than XSD, and relies on at least one of those features (interleave); that’s why you get that error.

So it’s possible an editor validating against an XSD conversion would flag some/many styles as invalid, or that it could create “valid” files that are not valid against the RNG schema.

Ok, I see.

I prefer VScode to Atom, but I cannot use RNG with the available XML helper packages. XSD would be an option though. But not if this could produce false negatives/positives…

To be clear, I’m just speculating. Interleave allows you to specify an unordered list of requirements. Normally, to convert that to a language that does not support unordered statements (like XSD), you’d need a looser definition.

So logically, what I suggest is possible. Not sure how big a practical problem it is though.

You could experiment a bit.