bug report: repeated schema-declared element content

Assignment: write a RELAX NG schema for Keats _On first looking into Chapman's Homer_. I (deliberately) wrote a ridiculously literalist schema, attached. When I create a new XML document that uses this schema, oXygen properly inserts the required elements, including all 14 required <pLine> elements. When I ask for auto-completion (CTL-space) of the <head> or any of the @n, oXygen does the right thing and gives me the one and only correct choice as the only possible value in the pop-up. But when I ask for auto-completion of <pLine>s 2 through 14, the one and only possible value in the pop-up is the content for the first <pLine>! Worth noting that jing gets it right. After filling in the content using auto-completion, validation will say of <pLine> 2, e.g., character content of element "pLine" invalid; must be equal to "And many goodly states and kingdoms seen;" Details: <oXygen/> XML Developer 17.0, build 2015052917 Mac OS X 10.6.8 error occurs using XML syntax or compact syntax Also tested on: <oXygen/> XML Developer 17.0, build 2015051321 Ubuntu 12.04 only tested compact syntax start = element poem { element head { "On first looking into Chapman's Homer" }, element sonnet { element pLine { attribute num { "01" }, "Much have I travell'd in the realms of gold," }, element pLine { attribute num { "02" }, "And many goodly states and kingdoms seen;" }, element pLine { attribute num { "03" }, "Round many western islands have I been" }, element pLine { attribute num { "04" }, "Which bards in fealty to Apollo hold." }, element pLine { attribute num { "05" }, "Oft of one wide expanse had I been told" }, element pLine { attribute num { "06" }, "That deep-brow'd Homer rules as his demesne;" }, element pLine { attribute num { "07" }, "Yet did I never breathe its pure serene" }, element pLine { attribute num { "08" }, "Till I heard Chapman speak out loud and bold:" }, element pLine { attribute num { "09" }, "Then felt I like some watcher of the skies" }, element pLine { attribute num { "10" }, "When a new planet swims into his ken;" }, element pLine { attribute num { "11" }, "Or like stout Cortez when with eagle eyes" }, element pLine { attribute num { "12" }, "He star'd at the Pacific — and all his men" }, element pLine { attribute num { "13" }, "Look'd at each other with a wild surmise —" }, element pLine { attribute num { "14" }, "Silent, upon a peak in Darien." } } } -- Syd Bauman, EMT-Paramedic Senior XML Programmer/Analyst Northeastern University Women Writers Project s.bauman@neu.edu or Syd_Bauman@alumni.Brown.edu

Hi Syd, Thanks for the samples, I reproduced the issue on our side and I'll add an issue for it. I'm not sure how easy this is to fix on our side, probably we have some caching based on the element name but we'll look into it. Is your schema an exercise or is it meant for a real situation? Regards, Radu Radu Coravu <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 8/21/2015 11:30 PM, Syd Bauman wrote:
Assignment: write a RELAX NG schema for Keats _On first looking into Chapman's Homer_.
I (deliberately) wrote a ridiculously literalist schema, attached.
When I create a new XML document that uses this schema, oXygen properly inserts the required elements, including all 14 required <pLine> elements. When I ask for auto-completion (CTL-space) of the <head> or any of the @n, oXygen does the right thing and gives me the one and only correct choice as the only possible value in the pop-up.
But when I ask for auto-completion of <pLine>s 2 through 14, the one and only possible value in the pop-up is the content for the first <pLine>!
Worth noting that jing gets it right. After filling in the content using auto-completion, validation will say of <pLine> 2, e.g., character content of element "pLine" invalid; must be equal to "And many goodly states and kingdoms seen;"
Details: <oXygen/> XML Developer 17.0, build 2015052917 Mac OS X 10.6.8 error occurs using XML syntax or compact syntax
Also tested on: <oXygen/> XML Developer 17.0, build 2015051321 Ubuntu 12.04 only tested compact syntax
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Hi Syd, For performance reasons we use as context information for content completion the path to the root, including attributes and eventual previous sibling elements, including their attributes. In this case, the context is like this: <poem> <head> <sonnet> <pLine num="02"> ??? where ??? is the place we try to find what content is allowed by the schema. We also use Jing, and in this case it seems it will give an error on the num="02" attribute and it recovers ignoring that value, probably using the first pLine pattern, so then when we look into what values are available for that element, we get the value of the first line. Usually the context information that we use is enough, but in some cases that use co-occurrence constraints that is not enough and more context information is needed, in some cases the entire document may be needed to decide what to insert next in the document. Unfortunately in this situation the context information we pass along is not enough and the recovery that Jing does when we feed it with the context fragment gives an unexpected value. I cannot think of a true fix for this other than passing the entire document content as content completion context. A simpler fix, that will solve this specific situation, may be to extend the content completion with previous siblings of the parent. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 21/08/15 23:30, Syd Bauman wrote:
Assignment: write a RELAX NG schema for Keats _On first looking into Chapman's Homer_.
I (deliberately) wrote a ridiculously literalist schema, attached.
When I create a new XML document that uses this schema, oXygen properly inserts the required elements, including all 14 required <pLine> elements. When I ask for auto-completion (CTL-space) of the <head> or any of the @n, oXygen does the right thing and gives me the one and only correct choice as the only possible value in the pop-up.
But when I ask for auto-completion of <pLine>s 2 through 14, the one and only possible value in the pop-up is the content for the first <pLine>!
Worth noting that jing gets it right. After filling in the content using auto-completion, validation will say of <pLine> 2, e.g., character content of element "pLine" invalid; must be equal to "And many goodly states and kingdoms seen;"
Details: <oXygen/> XML Developer 17.0, build 2015052917 Mac OS X 10.6.8 error occurs using XML syntax or compact syntax
Also tested on: <oXygen/> XML Developer 17.0, build 2015051321 Ubuntu 12.04 only tested compact syntax
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

Thanks for the quick response and information, George and Radu. I had not realized the process was so complex (although I am not surprised). I'm wondering if it might be a lot easier to detect "this is complicated" and just not perform autocompletion if it is. RD> Is your schema an exercise or is it meant for a real situation? Heh-heh. Not only is it a demonstration schema, it is a demonstration of how NOT to write a schema. So not real at all. GB> For performance reasons we use as context information for content GB> completion the path to the root, including attributes and eventual GB> previous sibling elements, including their attributes. In this case, the GB> context is like this: GB> GB> GB> <poem> GB> <head> GB> <sonnet> GB> <pLine num="02"> GB> ??? GB> GB> where ??? is the place we try to find what content is allowed by the schema. GB> GB> We also use Jing, and in this case it seems it will give an error on the GB> num="02" attribute and it recovers ignoring that value, probably using GB> the first pLine pattern, so then when we look into what values are GB> available for that element, we get the value of the first line. GB> GB> Usually the context information that we use is enough, but in some cases GB> that use co-occurrence constraints that is not enough and more context GB> information is needed, in some cases the entire document may be needed GB> to decide what to insert next in the document. Unfortunately in this GB> situation the context information we pass along is not enough and the GB> recovery that Jing does when we feed it with the context fragment gives GB> an unexpected value. GB> GB> I cannot think of a true fix for this other than passing the entire GB> document content as content completion context. A simpler fix, that will GB> solve this specific situation, may be to extend the content completion GB> with previous siblings of the parent.

On 24/08/2015 4:57 pm, George Bina wrote:
I cannot think of a true fix for this other than passing the entire document content as content completion context. A simpler fix, that will solve this specific situation, may be to extend the content completion with previous siblings of the parent.
Isn't this exactly the sort of thing D4P was designed for, all those non-technical document forms like poetry and prose? I haven't tested it yet so I could be wrong, but maybe planting a D4P DITA map inside a Relax NG DITA map in order to take advantage of other RNG options is possible? I have the nagging feeling that that's a big maybe, though, possibly too big. Regards, Ben

Hi Ben, Well, D4P may very well encode such information if you are thinking about the DITA landscape. However, the issue here was not related to any particular XML vocabulary, but rather a limitation of the content completion that oXygen provides in a very particular case, that is not likely to appear in practice. Best Regards, George -- George Cristian Bina <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com On 25/08/15 22:43, Ben McGinnes wrote:
On 24/08/2015 4:57 pm, George Bina wrote:
I cannot think of a true fix for this other than passing the entire document content as content completion context. A simpler fix, that will solve this specific situation, may be to extend the content completion with previous siblings of the parent.
Isn't this exactly the sort of thing D4P was designed for, all those non-technical document forms like poetry and prose?
I haven't tested it yet so I could be wrong, but maybe planting a D4P DITA map inside a Relax NG DITA map in order to take advantage of other RNG options is possible? I have the nagging feeling that that's a big maybe, though, possibly too big.
Regards, Ben
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (4)
-
Ben McGinnes
-
George Bina
-
Oxygen XML Editor Support (Radu Coravu)
-
Syd Bauman