Converting this grammar:
default namespace = "http://example.com/ns"
namespace g = "http://example.com/ns"
namespace one = "http://example.com/ns/one"
namespace two = "http://example.com/ns/two"
start = g.start
oneAttributes = attribute one:* { text }*
twoAttributes = attribute two:* { text }*
commonAttributes = oneAttributes & twoAttributes
g.start =
element g:start {
commonAttributes,
empty
}
to xml with trang produces:
<grammar ns="http://example.com/ns/two"
xmlns:g="http://example.com/ns"
xmlns="http://relaxng.org/ns/structure/1.0">
<start>
<ref name="g.start"/>
</start>
<define name="oneAttributes">
<zeroOrMore>
<attribute>
<nsName ns="http://example.com/ns/one"/>
</attribute>
</zeroOrMore>
</define>
<define name="twoAttributes">
<zeroOrMore>
<attribute>
<nsName/>
</attribute>
</zeroOrMore>
</define>
<define name="commonAttributes">
<interleave>
<ref name="oneAttributes"/>
<ref name="twoAttributes"/>
</interleave>
</define>
<define name="g.start">
<element name="g:start">
<ref name="commonAttributes"/>
<empty/>
</element>
</define>
</grammar>
To my eye, the ns attribute is missing from the nsName in the twoAttributes pattern.
Is that a bug in trang, or a misunderstanding on my part?
Converting this grammar:
to xml with trang produces:
To my eye, the
nsattribute is missing from thensNamein thetwoAttributespattern.Is that a bug in trang, or a misunderstanding on my part?