Content completion in included XML documents

<oXygen/> general issues.
Posts: 4
Joined: Wed Mar 28, 2007 9:53 pm

Content completion in included XML documents

Post by sgottlieb » Wed Mar 28, 2007 11:07 pm


I am writing a DocBook and breaking the various sections into different files along the lines of samples/docbook/sampleXInclude.xml. However, when I go into the included file with begins with a "section" element, Oxygen does not do content completion (as in make a list of available elements and attributes). I imagine this is because there is no namespace or doctype directive and I have been playing around with that but still have had no luck. Does anyone have any ideas?

Also, it would be great to open the parent document up in a browser and see all the included documents merged in. Any idea of an easy way to do that other than to write an XSL?



Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache » Thu Mar 29, 2007 10:18 am


If the content completion window does not appear probably you did not include a correct DOCTYPE declaration at the beginning of your DecBook section document. You can begin your section document as below:

Code: Select all

<!DOCTYPE section PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
If you press < after <section> the content completion window will suggest the DocBook elements title and sectioninfo.

For merging the included files into the master file I think you need an XSLT stylesheet.


Posts: 4
Joined: Wed Mar 28, 2007 9:53 pm

Post by sgottlieb » Fri Mar 30, 2007 5:39 am

That worked! For some reason I thought that including a doctype declaration in an included file would cause the parser to throw errors but



Site Admin
Posts: 2102
Joined: Thu Jan 09, 2003 2:58 pm

Post by george » Fri Mar 30, 2007 8:15 am

Hi Seth,

If you are using external entities to include other files then indeed you cannot add a DOCTYPE declaration in those included files.
For instance if you have

Code: Select all

<!ENTITY fragment SYSTEM "fragment.xml">
and then use &fragment; in your document to include the fragment.xml file then you cannot have a DOCTYPE declaration in fragment.xml.

Note that in oXygen you also have the alternative of external schema/DTD association. You can just go to the oXygen Options->Preferences -- Editor -- Default Schema Association page and add a rule there to associate your section files with DocBook.

oXygen provides ready to use support also for DocBook5 and it supports it very well. DocBook 5 provides as main schema a Relax NG schema with embedded Schematron rules and oXygen is able to validate your file against both the Relax NG and the Schematron rules as you edit. See more details in the DocBook hoto at the section taht present oXygen:

Best Regards,
George Cristian Bina

Post Reply