Ajax-like content completion list in oXygen?

I'm wondering how the following might be accomplished in oXygen. Suppose I have an index of terms stored in an XML file, call it "index.xml". The file looks like this: <index> <entry>cats : and dogs</entry> <entry>cats : and mice</entry> <!-- etc. --> <index> I am editing an XML file, call it "doc.xml", in which I want to insert index terms contained in the index file, like so: <p>In 2006 Felix the cat caught over 200 mice.<index><term>cats: and mice</term></index></p> While editing doc.xml, after I type "<term>", I want to access a list of possible entries drawn from index.xml. Ideally this would be implemented in the manner of popular Ajax-based form entry, so that typing the first few letters would call up a window containing a list of all index entries beginning with those letters. Because index.xml could contain thousands of entries, this goes beyond what oXygen content completion or code templates are designed to do. Would this task require writing a plug-in for oXygen? Or are there off-the-shelf Ajax tools that would work with the Eclipse version of oXygen to enable this kind of interaction? DS -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 801079, Charlottesville, VA 22904-4318 USA Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903 Email: dsewell@virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/

Hi David, This sounds like lots of fun, but I guess I want to know more about why you want to do this? Doesn't this really go against the re-use principle of XML text encoding? I mean, isn't it better to do something like <index sameAs="index.xml#catsAndDogs"/> pointing to an <entry xml:id="catsAndDogs"> in index.xml (or better, temporarily XIncluding it, so having local pointers oXygen has no problem providing in a drop-down list), so not entering the text in that point? XSLT postprocessing can of course then stick in the text if it is really needed for standalone distribution. ... But I know you know all of this, which is then what prompts my confusion. What is the benefit of sticking in the actual text rather than pointers to IDs? What is your use-case? Why is it better to put in the full text rather than a pointer? It does sound like a fun idea though. Just curious, -James David Sewell wrote:
I'm wondering how the following might be accomplished in oXygen.
Suppose I have an index of terms stored in an XML file, call it "index.xml". The file looks like this: <index> <entry>cats : and dogs</entry> <entry>cats : and mice</entry> <!-- etc. --> <index>
I am editing an XML file, call it "doc.xml", in which I want to insert index terms contained in the index file, like so:
<p>In 2006 Felix the cat caught over 200 mice.<index><term>cats: and mice</term></index></p>
While editing doc.xml, after I type "<term>", I want to access a list of possible entries drawn from index.xml. Ideally this would be implemented in the manner of popular Ajax-based form entry, so that typing the first few letters would call up a window containing a list of all index entries beginning with those letters.
Because index.xml could contain thousands of entries, this goes beyond what oXygen content completion or code templates are designed to do. Would this task require writing a plug-in for oXygen? Or are there off-the-shelf Ajax tools that would work with the Eclipse version of oXygen to enable this kind of interaction?
DS
-- Dr James Cummings, Oxford Text Archive, University of Oxford James dot Cummings at oucs dot ox dot ac dot uk

James, The use case is essentially to emulate the functionality of indexing software within an XML editing environment. Although I haven't used programs like CINDEX myself, my understanding is that they allow one to create an index, then use defined entries/subentries to generate a list of options for insertion within the file to be indexed. You're right that it would be better to use pointers than literal text, so that if entries in the index file are changed the references to them in the indexed text don't need to be manually updated. How does one get content completion in oXygen using XInclude? If I have an element like <xi:include href="index.xml" xpointer=""/> is content completion available on @xpointer? (I can't make it work, if so.) David On Sat, 7 Jul 2007, James Cummings wrote:
Hi David,
This sounds like lots of fun, but I guess I want to know more about why you want to do this? Doesn't this really go against the re-use principle of XML text encoding? I mean, isn't it better to do something like <index sameAs="index.xml#catsAndDogs"/> pointing to an <entry xml:id="catsAndDogs"> in index.xml (or better, temporarily XIncluding it, so having local pointers oXygen has no problem providing in a drop-down list), so not entering the text in that point? XSLT postprocessing can of course then stick in the text if it is really needed for standalone distribution. ... But I know you know all of this, which is then what prompts my confusion. What is the benefit of sticking in the actual text rather than pointers to IDs? What is your use-case? Why is it better to put in the full text rather than a pointer?
It does sound like a fun idea though.
Just curious, -James
David Sewell wrote:
I'm wondering how the following might be accomplished in oXygen.
Suppose I have an index of terms stored in an XML file, call it "index.xml". The file looks like this: <index> <entry>cats : and dogs</entry> <entry>cats : and mice</entry> <!-- etc. --> <index>
I am editing an XML file, call it "doc.xml", in which I want to insert index terms contained in the index file, like so:
<p>In 2006 Felix the cat caught over 200 mice.<index><term>cats: and mice</term></index></p>
While editing doc.xml, after I type "<term>", I want to access a list of possible entries drawn from index.xml. Ideally this would be implemented in the manner of popular Ajax-based form entry, so that typing the first few letters would call up a window containing a list of all index entries beginning with those letters.
Because index.xml could contain thousands of entries, this goes beyond what oXygen content completion or code templates are designed to do. Would this task require writing a plug-in for oXygen? Or are there off-the-shelf Ajax tools that would work with the Eclipse version of oXygen to enable this kind of interaction?
DS
-- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 801079, Charlottesville, VA 22904-4318 USA Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903 Email: dsewell@virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/

In message <alpine.OSX.0.999.0707090906580.2139@lister.ei.virginia.edu> David Sewell <dsewell@virginia.edu> writes: Hi David (quick answer, on the road at conferences),
How does one get content completion in oXygen using XInclude?
I was thinking that you XInclude the entirety of the index.xml file into your (say) teiHeader somewhere, and then all you index references are local, so oXygen picks up the @xml:id attributes automatically when producing a list of attribute values defined as pointers to such. The problem is, of course, that you get a list of all of index items and that might be a long list, but in starting to type them in that would take one to the right context quickly. I suppose its usefulness would be dependent on the number of index items one has, I've only used this technique for a small number of terms. -James
If I have an element like <xi:include href="index.xml" xpointer=""/> is content completion available on @xpointer? (I can't make it work, if so.)
David
On Sat, 7 Jul 2007, James Cummings wrote:
Hi David,
This sounds like lots of fun, but I guess I want to know more about why you want to do this? Doesn't this really go against the re-use principle of XML text encoding? I mean, isn't it better to do something like <index sameAs="index.xml#catsAndDogs"/> pointing to an <entry xml:id="catsAndDogs"> in index.xml (or better, temporarily XIncluding it, so having local pointers oXygen has no problem providing in a drop-down list), so not entering the text in that point? XSLT postprocessing can of course then stick in the text if it is really needed for standalone distribution. ... But I know you know all of this, which is then what prompts my confusion. What is the benefit of sticking in the actual text rather than pointers to IDs? What is your use-case? Why is it better to put in the full text rather than a pointer?
It does sound like a fun idea though.
Just curious, -James
David Sewell wrote:
I'm wondering how the following might be accomplished in oXygen.
Suppose I have an index of terms stored in an XML file, call it "index.xml". The file looks like this: <index> <entry>cats : and dogs</entry> <entry>cats : and mice</entry> <!-- etc. --> <index>
I am editing an XML file, call it "doc.xml", in which I want to insert index terms contained in the index file, like so:
<p>In 2006 Felix the cat caught over 200 mice.<index><term>cats: and mice</term></index></p>
While editing doc.xml, after I type "<term>", I want to access a list of possible entries drawn from index.xml. Ideally this would be implemented in the manner of popular Ajax-based form entry, so that typing the first few letters would call up a window containing a list of all index entries beginning with those letters.
Because index.xml could contain thousands of entries, this goes beyond what oXygen content completion or code templates are designed to do. Would this task require writing a plug-in for oXygen? Or are there off-the-shelf Ajax tools that would work with the Eclipse version of oXygen to enable this kind of interaction?
DS
-- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 801079, Charlottesville, VA 22904-4318 USA Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903 Email: dsewell@virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/

This has not yet been fixed in the 9.0 beta, apparently: for $s in ( 'dog', 'cat', 'ball') order by $s return $s "order by" is not highlighted as syntax keywords. -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 801079, Charlottesville, VA 22904-4318 USA Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903 Email: dsewell@virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/

Hi David, Thank you for reporting this. The problem was fixed in the current development stream, and will be available in the 9.0 final release. Regards, Mircea. David Sewell wrote:
This has not yet been fixed in the 9.0 beta, apparently:
for $s in ( 'dog', 'cat', 'ball') order by $s return $s
"order by" is not highlighted as syntax keywords.

I haven't been able to test 9.0 just yet, but while we're on the subject of XQuery highlighting... If you format a query like: for $s in ('dog', 'cat', 'ball') return $s then the 'for' is no longer highlighted. When I get a chance, I'll test the new version to see if it's already been fixed, but seeing as I'm one of the few people that formats queries in this way, I doubt it's been reported. On 10/23/07, Mircea Enachescu <mircea@oxygenxml.com> wrote:
Hi David,
Thank you for reporting this. The problem was fixed in the current development stream, and will be available in the 9.0 final release.
Regards, Mircea.
David Sewell wrote:
This has not yet been fixed in the 9.0 beta, apparently:
for $s in ( 'dog', 'cat', 'ball') order by $s return $s
"order by" is not highlighted as syntax keywords.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user

This is true for oXygen 9 beta as well. It looks like using line break instead of ordinary space within a FLWOR expression causes syntax coloring to disappear in various places. On Tue, 23 Oct 2007, Daniel Renfer wrote:
I haven't been able to test 9.0 just yet, but while we're on the subject of XQuery highlighting... If you format a query like:
for $s in ('dog', 'cat', 'ball') return $s
then the 'for' is no longer highlighted. When I get a chance, I'll test the new version to see if it's already been fixed, but seeing as I'm one of the few people that formats queries in this way, I doubt it's been reported.
On 10/23/07, Mircea Enachescu <mircea@oxygenxml.com> wrote:
Hi David,
Thank you for reporting this. The problem was fixed in the current development stream, and will be available in the 9.0 final release.
Regards, Mircea.
David Sewell wrote:
This has not yet been fixed in the 9.0 beta, apparently:
for $s in ( 'dog', 'cat', 'ball') order by $s return $s
"order by" is not highlighted as syntax keywords.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
-- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 801079, Charlottesville, VA 22904-4318 USA Courier: 310 Old Ivy Way, Suite 302, Charlottesville VA 22903 Email: dsewell@virginia.edu Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/

Hi David, There is not ready to use support in oXygen for that. One can indeed write a plugin both in Eclipse and in the standalone version to provide that functionality. Best Regards, George --------------------------------------------------------------------- George Cristian Bina - http://aboutxml.blogspot.com/ <oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger http://www.oxygenxml.com David Sewell wrote:
I'm wondering how the following might be accomplished in oXygen.
Suppose I have an index of terms stored in an XML file, call it "index.xml". The file looks like this: <index> <entry>cats : and dogs</entry> <entry>cats : and mice</entry> <!-- etc. --> <index>
I am editing an XML file, call it "doc.xml", in which I want to insert index terms contained in the index file, like so:
<p>In 2006 Felix the cat caught over 200 mice.<index><term>cats: and mice</term></index></p>
While editing doc.xml, after I type "<term>", I want to access a list of possible entries drawn from index.xml. Ideally this would be implemented in the manner of popular Ajax-based form entry, so that typing the first few letters would call up a window containing a list of all index entries beginning with those letters.
Because index.xml could contain thousands of entries, this goes beyond what oXygen content completion or code templates are designed to do. Would this task require writing a plug-in for oXygen? Or are there off-the-shelf Ajax tools that would work with the Eclipse version of oXygen to enable this kind of interaction?
DS
participants (6)
-
Daniel Renfer
-
David Sewell
-
George Cristian Bina
-
James Cummings
-
James Cummings
-
Mircea Enachescu