Creating New Doctypes with Apache Lenya

December 6, 2006 at 3:19 pm (Apache Lenya)

Hello,
This is a little tutorial about how to create a new Doctype with Apache Lenya. I have being working with this great tool 2 years now and I know the kinds of problems you kind find when creating a new Doctype. I believe that is because there is not much information on the web about it. So that’s what’s this all about, a little help for Lenya users.
CREATING A NEW DOCTYPE
First of all I will assume that you have already installed one version of Apache Lenya.
Now, let’s say we want to create the doctype : basic
Ok then, to create a new doctype you must follow this steps:

  1. The first step is to create the xml of the doctype and name it: basic.xml and save it in the folder:”\webapps\lenya\lenya\pubs\{yourPub}\config\doctypes\samples\”
    I assume you know XML, if not there are plenty of tutorials on the Web. Anyway you can download mine in the link shown at the bottom.
  2. Place the RelaxNG file with the name: “basic.rng” in the folder: “\webapps\accesible\lenya\pubs\{yourPub}\config\doctypes\schemas”
    I assume as well that you know how to create a RelaxNG file, if not you can use mine as I guide that’s available in the link at the bottom
  3. Add your XSL file with the name: “basic2xhml” in the folder: “\webapps\lenya\lenya\pubs\{yourPub}\xslt”
  4. Edit the file : “doctypes.xconf” that’s in: “\webapps\lenya\lenya\pubs\{yourPub}\config\doctypes\” and add a new “doc” element with the doctype name: “basic” and the sample-name: basic.xml.
    This will tell lenya there’s a new doctype available
  5. Edit the file: “generic.xsp” that’s in: “webapps\lenya\lenya\pubs\{yourPub}\config\menus\” and add a new “item” element with this atributes: uc:usecase=”create” uc:step=”showscreen” href=”?doctype=basic”. And the “i18n” element with the value: “New document basic”
    This will add a reference to create a document with the “basic” doctype in the Edit menu.
  6. Edit the file: “parameter-doctype.xmap” that’s in: “\webapps\lenya\lenya\pubs\{yourPub}\” add a new sourcetype element with the name attribute: “basic” and a “document-element” with the namespace: “http://www.salvador.com/basic”. It is important that the namespace you add here matches the one you have in you XML an RNG file. You can guide yourself with the one that Lenya has
  7. Edit the file: “content-namespaces.xml” that’s in: “\webapps\lenya\lenya\resources\misc\bxeng” and add a “xmlns” element with the value: “basic=http://www.salvador.com/basic”
  8. Ok, almost over now, the next step is to create the file: “basic-namespaces.xml” with the content that has the elements:
    “namespaces” and inside the “xmlns” element with the value:”basic=http://www.salvador.com/basic” and save it in: “\webapps\lenya\lenya\pubs\{yourPub}\resources\misc\bxeng”
  9. Finally create the:”basic-bxeng.css” file with the style you wish and save it on the same folder as above. This is jsut for the Bitflux editor.

Uff that’s a full one isn’t it? Well I hope this helps somebody ! Any comment or question please let me know I will be glad to help.
regards,
Salvador

Permalink Leave a Comment

Introduction

December 5, 2006 at 9:53 pm (Uncategorized)

Welcome to my blog !
This pretends to be a blog about a variety of information, more especificly things that have to do with this topics:

  • Computer Science
  • Space Science
  • Philosophy
  • History
  • others

As you may guess this are the topics that I’m interested about. My wish with this blog I just started is to share my thoughts with anybody who is interested in reading it and sharing it’s own opinion.
regards,
Salvador

Permalink 1 Comment