Content completion in included XML documents

Oxygen general issues.
sgottlieb
Posts: 4
Joined: Wed Mar 28, 2007 9:53 pm

Content completion in included XML documents

Post by sgottlieb »

Hi,

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?

Thanks,

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

Post by sorin_ristache »

Hello,

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"
"http://www.docbook.org/xml/4.4/docbookx.dtd">
<section>
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.


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

Post by sgottlieb »

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

Thanks,

Seth
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Post by george »

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:
http://www.docbook.org/docs/howto/#editors-oxygen

Best Regards,
George
George Cristian Bina
Post Reply