Problem with auto-tags

Having trouble installing Oxygen? Got a bug to report? Post it all here.
smaug42
Posts: 44
Joined: Tue May 25, 2004 2:27 pm

Problem with auto-tags

Post by smaug42 »

I'm wondering.. have I got some setting wrong or.... ?

If I'm working in an XML doc, and entering tags, oXygen seems to be inconsistant with filling in the end tag. Sometimes when I type in the complete opening tag ( <tag> ) oXygen will follow it with the closing tag ( </tag> ) and place the cursor in between the open and close tags. Other times I'll type the opening tag, and oXygen does nothing. I have to manually close the tag.

Or, I type in an opening tag, enter the text that goes between the tags, and then type </ Sometimes oXygen will auto-fill the remainder of the closing tag, and other times it won't.. gives me the grey box with a list of tags... .often with only the one closing tag to choose from.

Running on Linux (kernel 2.6.11), Java 1.4.2_08, oXygen 6.1 Build 2005071905 (also happened in oXygen 6.0)
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

The rules of adding the closing tag when you enter the > on the start tag are quite simple. If oXygen finds a matching end tag for your start tag then it will not enter the closing tag. If you see the start tag underlined then that means a matching end tag was found.

I do not undesrtand exactly the second problem, maybe if you can send us a screenshot at support at oxygenxml dot com that will help. Basically the / character triggers the content completion. It you already have a prefix that matches a selection on the content completion then it inserts that element as an empty element, that is <element/>. If there is no prefix, that is it is inserted after < and the end tag is in the content completion proposals then it will insert the end tag.

Best Regards,
George
smaug42
Posts: 44
Joined: Tue May 25, 2004 2:27 pm

Post by smaug42 »

Those are the rules I expect it to work on... thing is... it doesn't always work that way (at least not for me).

It's hard to describe... maybe if I go into more detail with the first problem... I start typing in my defined tags... for example (in a spot where vli is allowed):

Code: Select all

<vli>
When I type the > I would expect oXygen to add on the </vli> tag automatically and place the cursor inbetween the tags.

Sometimes it does this. Other times... nothing. in fact I can type several tags in a row... for example:

Code: Select all

<vli><vt><b>
And sometimes oXygen will wake up and add in the closing tag for one of the three tags... sometimes 2 of them... sometimes all three (the expected behavior).

So, sometimes I get only:

Code: Select all

<vli><vt><b>
other times:

Code: Select all

<vli><vt><b></b>
and other times:

Code: Select all

<vli><vt><b></vt>
and so on....

This is all in a single document, and happens regardless of opening a new document, or using an existing document.

I just now opened a new document. I typed in 4 xml tags in a row... vl, vli, vt, and b. vl is always the parent tag. vli must have vl as it's parent, vt must have vli as it's parent, and b is allowed in the vt tag. I did this 10 times in a row, only typing in the 4 start tags. This is what I see in oXygen:

Code: Select all


  <vl><vli><vt><b></b></vl>
<vl><vli><vt><b></b></vt></vl>
<vl><vli><vt><b></b></vt></vl>
<vl><vli><vt><b></vt></vl>
<vl><vli><vt><b></b></vt></vli>
<vl><vli><vt><b>
<vl><vli><vt><b></b></vt></vl>
<vl><vli><vt><b></b></vt></vli></vl>
<vl><vli><vt><b></b></vt></vli>
<vl><vli><vt><b></b></vt></vli></vl>
The 8th and 10th lines are the only ones that actually ended up being filled in correctly even though the exact same thing was typed each of the 10 times.

You say the rules are simple... that if oXygen finds a matching end tag for the start tag then it will NOT enter the closing tag? Ummm is that a typo? Shouldn't it be that if oXygen finds a matching end tag then it WILL enter the closing tag.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

Hi,

Sorry, I cannot reproduce the problem.
Adding vl, vli, vt, b several times on a File->New--XML document I get:

Code: Select all


<?xml version="1.0" encoding="UTF-8"?>
<vl><vli><vt><b></b></vt></vli></vl>
<vl><vli><vt><b></b></vt></vli></vl>
<vl><vli><vt><b></b></vt></vli></vl>
<vl><vli><vt><b></b></vt></vli></vl>
<vl><vli><vt><b></b></vt></vli></vl>
<vl><vli><vt><b></b></vt></vli></vl>
No, it is not a typo. For instance if you have something like

Code: Select all


<element>
<element|
</element>
then entering > in the | marked position will not add </element> as the new start tag is matched with the existing </element> end tag, giving

Code: Select all


<element>
<element>
</element>
In general if you see <element| with an underscore highlighter then it is matched and the end tag will not be added automatically.

Best Regards,
George
smaug42
Posts: 44
Joined: Tue May 25, 2004 2:27 pm

Post by smaug42 »

then entering > in the | marked position will not add </element> as the new start tag is matched with the existing </element> end tag,
That makes sense... I didn't read close enough the first time. :-) And.. this is exactly what happens for me where I have an end tag already in the code and I type a > at the marked position as you described. As far as I can tell, this bit works right :-D
Sorry, I cannot reproduce the problem.
Adding vl, vli, vt, b several times on a File->New--XML document
Hmmmm I wonder what is making it act like this for me.... I get these results (the 10 line example I gave in the previous post) for any combinations of any tag I type in.

Java:

Code: Select all

java -version
java version "1.4.2_08"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_08-b03)
Java HotSpot(TM) Client VM (build 1.4.2_08-b03, mixed mode)
My Linux Kernel:

Code: Select all

uname -r
2.6.11.4-21.7-default
and using the latest available oXygen build (6.1 build 2005071905). It's worth noting that this also happened exactly the same on 6.0. I can't remember what it did in the 5.x builds. I wasn't using oXygen as much then.

What other info can I provide to help here?

It's not a show stopper problem... just annoying that it is inconsistant. It's a very convenient feature when it works.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,
smaug42 wrote:What other info can I provide to help here?
Please post all the content of the document and the exact location where typing > reproduces the tag autocompletion problem. The location is displayed in the status bar as line:column. If the document declares a schema or DTD also post the content of that.

Best regards,
Sorin
smaug42
Posts: 44
Joined: Tue May 25, 2004 2:27 pm

Post by smaug42 »

The problem is reproduceable on any line:column position within the page. It is also easily reproduceable in a new document or when I edit an existing document... again, on any line:column in the document (between the page tags of course)

Here is a sample document (some text has been replaced with "Company" in the examples). Note... this tag completion problem happens with any tag combination. I just use the vl tags because they are small and it's easy to show examples with this tag. I also cannot easily test on other platforms... I only have/use Linux.

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE page PUBLIC "-//Company//DTD Page 1.1//EN" "page.dtd">
<page author="$Author: clayton $" base="" date="$Date: 2005/07/25 10:55:12 $"
rcsfile="$RCSfile: test.xml,v $" revision="$Revision: 1.1 $"
source="$Source: /home/cvsroot/company/doc/xml/test.xml,v $">
<title>Test document</title>
<p>Test document for auto tag problem</p>
<!-- These tags are typed in order... first vl, then vli,
then vt, then b -->
<vl><vli><vt><b></b></vt>
<vl><vli><vt><b></b></vt></vli>
<vl><vli><vt><b></b>
<!-- and so on -->
<!-- this document will not validate in this form because
I did not complete each set of the vl tags -->
</page>
I have a catalog file that points to where all my DTDs are located.
The DTDs are not so easy to post... there are a lot. I don't have all my DTD stuff all neatly packaged into one file.

This is page.dtd

Code: Select all

<!ENTITY % build.ent PUBLIC "-//Company//Build Entities 1.0//EN" "build.ent">
%build.ent;

<!ENTITY % common.ent PUBLIC "-//Company//Common Entities 1.0//EN" "common.ent">
%common.ent;

<!ENTITY % toplevel.custom "|section|related">

<!ENTITY % markup.mod PUBLIC "-//Company//DTD Markup 1.1//EN" "markup.mod">
%markup.mod;

<!ELEMENT page (title,locations?,(%toplevel.mix;)*)>
<!ATTLIST page %level.attr;
%cvs.attr;
%review.attr;
base CDATA #IMPLIED>

<!ELEMENT section (title, (%toplevel.mix;)*)>
<!ATTLIST section %level.attr;>

<!ELEMENT related (%see.mix;)*>
The file common.ent contains all my "boilerplate" replaceable text like copyright statements, etc. The file build.ent contains all the build specifi info.. build date, status, version, etc.

The markup.mod is where most of the interesting stuff is... and I've selected a few bits from it (related to the vl tags) - it's rather large to be posting here...

Code: Select all

<!-- List tags -->
<!ENTITY % list.mix "ol|ul|vl">

<!ENTITY % listitem.doc "vli|vt|vd|vx|li">

<!-- Description list tag -->
<!ELEMENT vl (vli)*>
<!ATTLIST vl %all.attr;
%class.attr;>
<!ELEMENT vli (vt*,vx*,vd)>
<!ATTLIST vli %all.attr;>

<!-- List item tags -->
<!ELEMENT vt (#PCDATA|%inline.mix;)*>
<!ATTLIST vt %all.attr;>
<!ELEMENT vd (%listitem.mix;)*>
<!ATTLIST vd %all.attr;>
<!ELEMENT vx (#PCDATA|%inline.mix;)*>
<!ATTLIST vx %all.attr;>

<!-- All the tags that can be used as inline -->
<!ENTITY % inline.mix "b|i|replaceable|userinput|computeroutput|instructions|link|%see.mix;|img|br|tag%inline.custom;">
Post Reply