Displaying content of document level entities in Author mode

<oXygen/> general issues.
honyk
Posts: 166

Displaying content of document level entities in Author mode

Wed Aug 19, 2009 10:19 am

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: 4144

Re: Displaying content of document level entities in Author mode

Wed Aug 19, 2009 11:23 am

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: 166

Re: Displaying content of document level entities in Author mode

Wed Aug 19, 2009 12:35 pm

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: 4144

Re: Displaying content of document level entities in Author mode

Wed Aug 19, 2009 2:25 pm

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: 166

Re: Displaying content of document level entities in Author mode

Wed Aug 19, 2009 4:32 pm

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: 4144

Re: Displaying content of document level entities in Author mode

Wed Aug 19, 2009 5:13 pm

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: 166

Re: Displaying content of document level entities in Author mode

Wed Aug 19, 2009 5:56 pm

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: 166

Re: Displaying content of document level entities in Author mode

Wed Aug 19, 2009 6:21 pm

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: 4144

Re: Displaying content of document level entities in Author mode

Thu Aug 20, 2009 12:12 pm

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

Return to “Other Issues”

Who is online

Users browsing this forum: No registered users and 1 guest