Displaying content of document level entities in Author mode

Oxygen general issues.
honyk
Posts: 176
Joined: Wed Apr 29, 2009 4:55 pm

Displaying content of document level entities in Author mode

Post by honyk »

Hello,

is there any possibility to show the content of defined entities? By default there is displayed only entity name in tag, not content itself. Is there way via CSS's content feature?

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

Re: Displaying content of document level entities in Author mode

Post by sorin_ristache »

Hello,

By default the content of entities is displayed in Author mode because that is specified by the option Display referred content that is available in Preferences -> Editor -> Pages -> Author and this option is enabled by default. Did you disable this option?


Regards,
Sorin
honyk
Posts: 176
Joined: Wed Apr 29, 2009 4:55 pm

Re: Displaying content of document level entities in Author mode

Post by honyk »

Option is enabled, there is no problem to load content via xi:includes, but in this case it is not so called referred content I think:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY atr-ac "Specifies the number of ...">
<!ENTITY atr-ai "Specifies a delay ...">
I don't know exact name, maybe character entities...
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Displaying content of document level entities in Author mode

Post by sorin_ristache »

Do you mean showing the entities atr-ac and atr-ai? The declared entities are displayed in the Entities view. They are displayed in the editor where entity references are used, that is &atr-ac; and &atr-ai;.


Regards,
Sorin
honyk
Posts: 176
Joined: Wed Apr 29, 2009 4:55 pm

Re: Displaying content of document level entities in Author mode

Post by honyk »

You are right. If entities are specified in the main document and used directly in it, they are displayed correctly (I didn't make this easiest proof before). But if they are used in xincluded parts (my case), although defined globally, they are not resolved in Author view of the main document.
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Displaying content of document level entities in Author mode

Post by sorin_ristache »

Do you mean to edit an included part file when the current Author document is the master file that includes all part files? That is not possible because the included part files are read-only (have grey background) not because an ID declared in the master file is not available in the auto completion popup for the linkend attribute in an included part file. You can see that when editing the included part file. Just click on the Open icon in the master file at the beginning of the grey area of the included file. The validation scenario with the master file must be set on the part file.


Regards,
Sorin
honyk
Posts: 176
Joined: Wed Apr 29, 2009 4:55 pm

Re: Displaying content of document level entities in Author mode

Post by honyk »

Finally I am quite sure it is caused by non valid master document. If master document is not valid, its content is not available to child even with properly set validation scenario and hence entities defined there cannot be resolved properly.
From my point of view the master document is valid (despite of Xerces complaints), but I must prove it somehow...
honyk
Posts: 176
Joined: Wed Apr 29, 2009 4:55 pm

Re: Displaying content of document level entities in Author mode

Post by honyk »

Could somebody explain, what is wrong with the following use case?
Master file (support for xi:include at this place is injected into local DTD):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
<!ENTITY test "Test of global entity.">
]>
<book>
<title>Test</title>
<xi:include href="external.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
</book>
Child file (external.xml):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<chapter>
<title>Chapter</title>
<para>&test;</para>
</chapter>
I am getting "E [Xerces] The entity "test" was referenced, but not declared." and instead of entity content there is nothing displayed.
Is there some issue with order of resolving xi:includes and entities?
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Re: Displaying content of document level entities in Author mode

Post by sorin_ristache »

honyk wrote:Child file (external.xml):

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN" "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<chapter>
<title>Chapter</title>
<para>&test;</para>
</chapter>
I am getting "E [Xerces] The entity "test" was referenced, but not declared." and instead of entity content there is nothing displayed.
Is there some issue with order of resolving xi:includes and entities?
Yes, entity references are resolved before xi:include references. That means the entity must be declared in the same file as the reference.


Regards,
Sorin
Post Reply