RelaxNG "autocompletion"

Hello, with the following grammar the contents of the element "foo" can either be the attribute "att" _or_ the element "elt". <?xml version="1.0" encoding="UTF-8"?> <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <start> <element name="root"> <oneOrMore> <element name="foo"> <choice> <attribute name="att" /> <element name="elt"><text /></element> </choice> </element> </oneOrMore> </element> </start> </grammar> But when I insert <foo> into the editor, oxygen gives me the element <elt> as a child. So I have to delete the element manually if I use the attribute 'att'. I find this behavior a bit of a nuisance. Is this on purpose? Patrick

Hi Patrick, It seems an issue with the generation of required content based on Relax NG schemas. Until we fix that you can disable the generation of element content from Options->Preferences -- Editor / Content Completion, disable the "Add element content" option. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com Patrick Gundlach wrote:
Hello,
with the following grammar the contents of the element "foo" can either be the attribute "att" _or_ the element "elt".
<?xml version="1.0" encoding="UTF-8"?> <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes"> <start> <element name="root"> <oneOrMore> <element name="foo"> <choice> <attribute name="att" /> <element name="elt"><text /></element> </choice> </element> </oneOrMore> </element> </start> </grammar>
But when I insert <foo> into the editor, oxygen gives me the element <elt> as a child. So I have to delete the element manually if I use the attribute 'att'. I find this behavior a bit of a nuisance. Is this on purpose?
Patrick
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Patrick, (This is a little too technical:) What happened was that we looked at the Relax NG pattern for the element content after closing the element start tag. I changed that to look at the pattern immediately after the start tag and that fixes the issue you reported as that pattern contains also the attributes that can appear in that element. This will will be available in the oXygen 11.0 build that we will make available later today. For getting updates when new builds are available you can subscribe to http://www.oxygenxml.com/rssBuildID.xml Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com George Cristian Bina wrote:
Hi Patrick,
It seems an issue with the generation of required content based on Relax NG schemas. Until we fix that you can disable the generation of element content from Options->Preferences -- Editor / Content Completion, disable the "Add element content" option.
Best Regards, George
participants (2)
-
George Cristian Bina
-
Patrick Gundlach