Loading ...
Sorry, an error occurred while loading the content.

Re: Looking for RNG versions of the DITA DTDs

Expand Messages
  • Steinar Bang
    ... I first tried the approach suggested by Florent Georges, ie. generate the RNC for each DTD into separate directories. Then I tried the script suggested by
    Message 1 of 6 , Nov 23, 2007
    • 0 Attachment
      >>>>> Bjoern Hoehrmann <derhoermi@...>:

      > * Steinar Bang wrote:
      >> I've tried creating RNC schemas from the DITA DTDs using trang, but they
      >> fail in nxml. There's a complaint of duplicate definition, like eg. this:

      > http://lists.w3.org/Archives/Public/www-archive/2005Feb/0029.html has
      > a xmllint-based script that should expand all entities; that should
      > make it a lot simpler for trang to do the conversion (at the expense
      > of some structure).

      I first tried the approach suggested by Florent Georges, ie. generate
      the RNC for each DTD into separate directories.

      Then I tried the script suggested by Björn Höhrmann (a bourne shell
      version of the script is at the end of the message), used it to generate
      DTDs with expanded entities, that then were run through trang to create
      single-file RNC schemas.

      The resulting schemas from both approaches gave me the same problem:

      The schemas loaded without error messages (which was an improvement :-) ).

      But instead of <task> or <concept> (the only two document types I
      tested) as the top directory, both DTDs had <no-topic-nesting> with no
      children as the only legal element.

      So... I'm open for more suggestions...:-)


      - Steinar


      Here's a bourne shell version of Björn Höhrmann's script:

      #!/bin/sh
      #
      # Expand entities in DTD files
      #
      DTDFILE=$1
      perl -e 'print qq{<!DOCTYPE x [<!ENTITY \x25 x SYSTEM "$ARGV[0]">\x25x;]><x/>}' $DTDFILE > $DTDFILE.tmp
      xmllint --noent $DTDFILE.tmp | perl -ne 'local$/;$_=<>;s/^<!DOCTYPE x \[//;s/]>\s*<x\/>$//;s/<!--.*?-->//sg;s/<!ENTITY.*?>//sg; s/\n+/\n/g; print'
      rm $DTDFILE.tmp
    • Steinar Bang
      For those who do not follow the nxml list as well. I found a solution at http://tech.groups.yahoo.com/group/dita-users/message/6711 Basically, it s first
      Message 2 of 6 , Dec 8, 2007
      • 0 Attachment
        For those who do not follow the nxml list as well. I found a solution
        at
        http://tech.groups.yahoo.com/group/dita-users/message/6711

        Basically, it's first Florent Georges' approach, then manually changing
        the start declaration of each generated RNC schema (well, actually I
        only needed to change some of them. Some were ok).

        A working schema can be found as an attachment to this message:
        http://permalink.gmane.org/gmane.emacs.nxml.general/1634
      • Florent Georges
        Steinar Bang wrote: Hi ... I recently reviewed the way I generated an RNC schema from a set of WXS schema modules. I had also to make some corrections and
        Message 3 of 6 , Dec 9, 2007
        • 0 Attachment
          Steinar Bang wrote:

          Hi

          > Basically, it's first Florent Georges' approach, then manually
          > changing the start declaration of each generated RNC schema
          > (well, actually I only needed to change some of them. Some
          > were ok).

          I recently reviewed the way I generated an RNC schema from a set of
          WXS schema modules. I had also to make some corrections and changes to
          the result. What I found really useful was to generate an RNG schema
          first, then apply an XSLT stylesheet on it to make the fine-tuning.

          That has the double advantage to be fully automated and to centralize
          the changes to make in a single place, the stylesheet.

          For a few notes, you can look for my post on the nXML list a few days
          ago about WSDL RNC schemas.

          Regards,

          --drkm






















          _____________________________________________________________________________
          Ne gardez plus qu'une seule adresse mail ! Copiez vos mails vers Yahoo! Mail http://mail.yahoo.fr
        Your message has been successfully submitted and would be delivered to recipients shortly.