
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