djc / rnc2rng

RELAX NG Compact to regular syntax conversion library
MIT License
16 stars 13 forks source link

CSL name moved from attribute on <element> and <attribute> to new child node #4

Closed jayvdb closed 8 years ago

jayvdb commented 8 years ago

When I do a diff between trang and rnc2rng results for https://github.com/citation-style-language/schema/blob/master/csl.rnc (i.e. this is a continuation of #1), the only difference is name is being moved from an attribute to a child node 'name'.

@@ -42,9 +42,11 @@
       </choice>
     </start>
     <define name="independent-style.style">
-      <element name="cs:style">
-        <attribute name="class">
+      <element>
+        <name ns="http://purl.org/net/xbiblio/csl">style</name>
+        <attribute>
           <a:documentation>Select whether citations appear in-text or as notes.</a:documentation>
+          <name ns="">class</name>
           <choice>
             <value>in-text</value>
             <value>note</value>

That type of change occurs hundreds of times in the output.

djc commented 8 years ago

Yes. According to my reading of the RELAX NG spec, these are equivalent, see section 4.8 here:

https://www.oasis-open.org/committees/relax-ng/spec-20011203.html#IDAEAZR

Due to the way the schema generation is done, doing it this way add less complexity in rnc2rng, and should be more optimal during validation because the simplication step doesn't have to be done.

Does this cause problems for you? If so, why?

jayvdb commented 8 years ago

The empty ns in <name ns="">class</name> is my main concern. I havent yet tried to use it. Will do so over the weekend.

jayvdb commented 8 years ago

It looks like it does cause a problem. https://travis-ci.org/jayvdb/citeproc-py/builds/97387207 (I'm still digging into the cause..)

djc commented 8 years ago

Hmm, that thing is not very explicit on what is failing though.

jayvdb commented 8 years ago

This issue was not the problem causing the tests to fail. The citeproc schema is fixed with #6.

jayvdb commented 8 years ago

fwiw, I started to 'fix' this, and have a partial solution at https://github.com/djc/rnc2rng/compare/master...jayvdb:issue_4 I can continue it if you like.

djc commented 8 years ago

I'd prefer to keep it as-is, for the reasons outlined above.