T
Tim Scarfe
Hello All,
I have an application where I identify fragments of a document as
being a custom object as defined in my respective schema. I
right-click a document selection, go-to "Apply XML Element" and then
click on my schema object context (so far, so good).
The problem is that in some cases, Word will not surround my entire
selection with the schema object tags[1], it will instead break at an
arbitrary point between the start of the selection, and the end of the
selection.
I have tried adding a comment to the same fragment using the "Insert
Comment" facility, and it worked as expected[2].
After some research I found out that having a "Soft Break" before the
start of the selection seemed to be the cause of the problem.
Selecting from "Hard Break" to "Hard Break" seems to work in a
consistent fashion[3]. Judging that the behaviour is inconsistent with
that of inserting a "Comment", I thought that this could possibly be a
bug.
Another interesting thing to point out is that in the case with a
"Soft Break", the background colour of the enclosing XML elements (in
the Word application environment) is of a darker shade than that of
the example preceded with a "Hard Break". This leads me to think that
this behaviour is somehow by design but I don't understand how it
works.
I understand the likelihood of XML such as follows being generated
under the covers (which might explain the strange choice of
behaviour):
<regulation>
<p>this is invalid XML
</regulation>
</p>
I would very much appreciate some further insight on this matter.
Kind Regards,
trs
[1] http://www.developer-x.com/test/word/wordregbug.JPG
[2] http://www.developer-x.com/test/word/wordcomment.JPG
[3] http://www.developer-x.com/test/word/wordcomment.JPG
P.S. I have made a copy of said document available as a test case
located at:
http://www.developer-x.com/ssi2000323.doc (Section 29(5)(b))
I have an application where I identify fragments of a document as
being a custom object as defined in my respective schema. I
right-click a document selection, go-to "Apply XML Element" and then
click on my schema object context (so far, so good).
The problem is that in some cases, Word will not surround my entire
selection with the schema object tags[1], it will instead break at an
arbitrary point between the start of the selection, and the end of the
selection.
I have tried adding a comment to the same fragment using the "Insert
Comment" facility, and it worked as expected[2].
After some research I found out that having a "Soft Break" before the
start of the selection seemed to be the cause of the problem.
Selecting from "Hard Break" to "Hard Break" seems to work in a
consistent fashion[3]. Judging that the behaviour is inconsistent with
that of inserting a "Comment", I thought that this could possibly be a
bug.
Another interesting thing to point out is that in the case with a
"Soft Break", the background colour of the enclosing XML elements (in
the Word application environment) is of a darker shade than that of
the example preceded with a "Hard Break". This leads me to think that
this behaviour is somehow by design but I don't understand how it
works.
I understand the likelihood of XML such as follows being generated
under the covers (which might explain the strange choice of
behaviour):
<regulation>
<p>this is invalid XML
</regulation>
</p>
I would very much appreciate some further insight on this matter.
Kind Regards,
trs
[1] http://www.developer-x.com/test/word/wordregbug.JPG
[2] http://www.developer-x.com/test/word/wordcomment.JPG
[3] http://www.developer-x.com/test/word/wordcomment.JPG
P.S. I have made a copy of said document available as a test case
located at:
http://www.developer-x.com/ssi2000323.doc (Section 29(5)(b))