Entity auto complete not working in V10.3 ?

Having trouble installing Oxygen? Got a bug to report? Post it all here.
pgfuller
Posts: 4
Joined: Fri Jul 03, 2009 5:58 am

Entity auto complete not working in V10.3 ?

Post by pgfuller »

I recently upgraded from V10.2 to V10.3 and it appears that the auto completion of custom entities is no longer working.

Only the standard &, &apos;, >, < and " show in the list after typing &.

I have many custom entities defined for keyboard commands, common names etc and these used to show up in the auto completion list.

Is this a bug, a configuration issue or something that I've stuffed up ?

Thanks.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Entity auto complete not working in V10.3 ?

Post by sorin_ristache »

Hello,

Entities should be displayed in the auto completion popup as in previous versions. If the schema of the document is large the initialization of the auto completion (of elements, attributes, entities) based on the schema could take some seconds. In such a case if you press '&' or '<' in the first seconds immediately after opening the XML document the initialization may not be finished yet and only the default 5 entities are available. Are all entities displayed if you wait for some more seconds before pressing '&'? If not please post or send a sample schema and XML document for reproducing the problem.

For example you know when the initialization is finished if you have Validate as you type enabled, your XML document is not valid and a validation error is displayed on the right side vertical stripe at a short time after opening the document and without modifying the document after opening it.


Regards,
Sorin
pgfuller
Posts: 4
Joined: Fri Jul 03, 2009 5:58 am

Re: Entity auto complete not working in V10.3 ?

Post by pgfuller »

Sorin,

Thank you for answering. It looks like a problem (probably mine) with how the entities are being included in my documents.

The entities for keys are defined in keys.txt similar to the following:

Code: Select all

<!ENTITY keyTest "<keycap>Test</keycap>">
<!ENTITY keyHome "<keycap>Home</keycap>">
<!ENTITY keyEnter "<keycap>Enter</keycap>">
This is just a small example for illustration. The real file has hundreds of entries. The same thing is done to create entities for inline icon images etc.

The files to be included sit in the same directory as the DocBook chapter files. In all of the documents where the keys are used, the entity definitions are included:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book
[
<!ENTITY % entity_Keys SYSTEM "keys.txt"> %entity_Keys;
]>
<chapter>
<Title>Chapter 1</Title>
<para>Press &keyHome; and everything will be revealed.</para>
</chapter>
Under V10.2 the auto completion would consider all of the entities defined in keys.txt. Now it does not show any of them.

The document still transforms into PDF with the entities included however.

I am quite new to DocBook, XML and <oXygen> so I appreciate any advice. If the whole method is wrong then let know how it should be done!

Thanks.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Entity auto complete not working in V10.3 ?

Post by sorin_ristache »

In version 10.3 your document is not associated with the DocBook 4 document type as in 10.2 but is should be because it does not specify a schema location, it specifies only the root element. We will fix the problem. Please insert the generic declaration for the DocBook DTD so that your document is associated with the DocBook 4 document type:

Code: Select all

<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"  "http://www.docbook.org/xml/4.4/docbookx.dtd"
[
<!ENTITY % entity_Keys SYSTEM "keys.txt"> %entity_Keys;
]>

Regards,
Sorin
pgfuller
Posts: 4
Joined: Fri Jul 03, 2009 5:58 am

Re: Entity auto complete not working in V10.3 ?

Post by pgfuller »

I would like to target DocBook 5.0.

The following is what I actually have in each chapter:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book
[
<!ENTITY % entity_Common SYSTEM "Entity_Common.txt"> %entity_Common;
<!ENTITY % entity_Icons SYSTEM "Entity_Icons.txt"> %entity_Icons;
<!ENTITY % entity_Menus SYSTEM "Entity_Menus.txt"> %entity_Menus;
<!ENTITY % entity_Samples SYSTEM "Entity_Samples.txt"> %entity_Samples;
]>
<chapter xml:id="Metadata" xmlns="http://docbook.org/ns/docbook" version="5.0">
<title>Managing Metadata</title>
<para>[etc]</para>
</chapter>
Sorry to mislead you with the previous snippet.

Is there a way to adapt this to V10.3?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Entity auto complete not working in V10.3 ?

Post by sorin_ristache »

Use a schema declaration like the following:

Code: Select all

<?oxygen RNGSchema="http://www.oasis-open.org/docbook/xml/5.0/rng/docbook.rng" type="xml"?>
<!DOCTYPE chapter
[
<!ENTITY % entity_Keys SYSTEM "keys.txt"> %entity_Keys;
]>
<chapter xml:id="Metadata" xmlns="http://docbook.org/ns/docbook" version="5.0">

...
and enable the option Enable DTD/XML Schema processing in Preferences -> Document Type Association.


Regards,
Sorin
pgfuller
Posts: 4
Joined: Fri Jul 03, 2009 5:58 am

Re: Entity auto complete not working in V10.3 ?

Post by pgfuller »

Sorin,

That is it! Everything works now.

Thank you for your help.

Paul
Post Reply