Closed ghost closed 7 years ago
Can you review c2586be076901b32d16ef9ac8971fa6d38d673d9, please?
If you're happy (and have no other bugs/concerns), I can put out a new release.
Thank'you @djc The patch works perfectly on the snippet I provided, but it seems it doesn't cover this use case I didn't provide yesterday:
default namespace = "https://namespace.com"
MyEl = element elem { attribute * - utils { text } }
(all attributes except "utils")
Produces:
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
ns="https://namespace.com">
<define name="MyEl">
<element>
<name ns="https://namespace.com">elem</name>
<attribute>
<anyName>
<except>
<name ns="https://namespace.com">utils</name>
</except>
</anyName>
<text/>
</attribute>
</element>
</define>
</grammar>
Should produce:
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
ns="https://namespace.com">
<define name="MyEl">
<element>
<name ns="https://namespace.com">elem</name>
<attribute>
<anyName>
<except>
<name ns="">utils</name>
</except>
</anyName>
<text/>
</attribute>
</element>
</define>
</grammar>
Should be fine after that, I can't think of other different contexts for attributes.
Please try with 2e5c56a and see if that works for you.
Perfect! ✨ You can ship it if you want. Thank'you very much!
I've uploaded version 2.4.1 to PyPI.
While elements inherit the namespace of their parent, attributes do not. See the official tutorial.
This rnc:
should produce this rng:
and not this: