Thanks for the offer, but I found it very straightforward - I'm very impressed with XXE's customisation ability!
Thanks again, Geraint. On 27 Jul 2007, at 9:53, Hussein Shafie wrote: > Geraint North wrote: >> >> I'm currently in the process of moving our documentation source to >> Docbook XML, and I find that we've got some domain-specific data that >> we can't easily represent using the Docbook schema - in >> particular, we >> need the ability to capture nested directory structures in our >> documentation. >> >> So, what I've done is written an XML Schema for a new namespace (call >> it "tt"), containing the additional elements, and I embed these in a >> Docbook XML document like so: >> >> <para> >> <tt:filesystem xmlns:tt="http://www.transitive.com/transitive"> >> <tt:directory name="/"> >> <tt:directory name="var"> >> <tt:directory name="accounts"> >> <tt:desc>The Solaris application "ReconcileAccounts" >> needs to >> alter files in <filename>/var/accounts/</filename></tt:desc> >> </tt:directory> >> </tt:directory> >> <tt:directory name="usr" /> >> </tt:directory> >> </tt:filesystem> >> </para> >> >> I've had have no problem in using the XSLT transforms to generate >> sensible PDF and HTML output from these new tags, but I'm having >> trouble coming up with a way for XMLMind to play nicely with this >> arrangement - ideally, I want anyone editing a DocBook XML >> document in >> XMLMind to be able to see elements like "tt:filesystem" in the list >> when they choose to insert new elements into the document. >> >> How could I go about doing this? The number of options seems >> pretty vast: >> >> - Use the DocBoox DTD, or XML Schema, or the RELAX NG Schema >> - Modify those namespaces, or write my own (with the definition in >> whatever format) >> - Define a new namespace that references the DocBook one and extends >> it, or reference my new namespace from within DocBook. >> >> I can't imagine that I'm the first person to try and achieve this - >> before I head off and find the wrong way of doing this, does anyone >> have any experiences they could share? > > Jirka Kosek wrote: >> Probably, the easiest method is to use DocBook V5 and create your >> customization in RELAX NG: >> >> http://www.docbook.org/docs/howto/#cust-add-elements >> >> To make this work in XXE you have just to modify existing DocBook 5 >> add-on and replace original DocBook schema with your customization >> and >> also add few new CSS rules to handle your newly added elements. > > I would also recommend to use DocBook V5. The DocBook W3C XML Schema > isn't something that really exists, therefore the real choice is > between > DocBook V4 (DTD) and DocBook V5 (RELAX NG). > > The first step is to customize the DocBook V5 RELAX NG schema (See > http://www.docbook.org/tdg5/en/html/ch05.html). Once you have done > this > (a task which is not directly related to XMLmind XML Editor), you can > either do: > > * What has suggested Jirka, which is the quick and dirty method. > > * OR a clean configuration for XMLmind XML Editor, which leverages the > stock DocBook V5 configuration, but which is separated from it. > > If you prefer to have a clean configuration, send me your customized > schema + an instance making use of this schema and I'll write the > configuration for you. > > > --------------- > PS (for Jirka): There is now a way to cleanly handle customizations of > DocBook V5 in XXE: > > [1] The configuration for the customization should have a "detect" > rule > which is different from the stock configuration. This "detect" rule > must > make use of "rootElementAttribute" (see > http://www.xmlmind.com/xmleditor/_distrib/doc/configure/detect.html). > Example: > > <rootElementAttribute localName="version" value="acme" > substring="true"/> > > [2] All the document templates must have a root element having the > corresponding attribute. Example: > > <book xmlns="http://docbook.org/ns/docbook" > version="5.0-extension acme-1.0">... > > -- > XMLmind XML Editor Support List > xmleditor-support at xmlmind.com > http://www.xmlmind.com/mailman/listinfo/xmleditor-support

