Skip to main content
1-Visitor
April 18, 2011
Question

"Flattening" a DTD

  • April 18, 2011
  • 24 replies
  • 4491 views
Good Morning!
Haven't seen anything even close to this one:

Most of our DTDs have a significant portion of their content in entities (in some cases, all but the root element). This promotes, of course, the use of the same structure for a given purpose across all doctypes.

Our problem is, when we deliver data, we deliver a copy of the then-current doctype DTD as well. This means someone must gather up copies of all the needed entities, as well as the main doctype file. That has proven to mildly error-prone.

We tested using Architect or Editor to flatten the entities ('doc_flatten all'), but without success. The former has no Command Line in the requisite window, and the latter insists on loading a DTD as an ASCII file, in which case 'doc_flatten' has no effect.

Thoughts? Ideas?

Thanks in Advance,
Steve Thompson
TAD Technical
Boeing-IDS Technical Publications
+1(316)977-0515
MC K83-08
The truth is the truth even if nobody believes it, and a lie is a lie even if everyone believes it.

NOTICE: This communication may contain proprietary or other confidential information. If you are not the intended recipient, or believe that you have received this communication in error, please do not print, copy, retransmit, disseminate, or otherwise use the information. Also, please indicate to the sender that you have received this e-mail in error, and delete the copy you received. Any and all views expressed are the current understanding of the sender and should not be interpreted as an expression of official Boeing Company policy or position.

Les renseignements contenus dans ce message peuvent être confidentiels. Si vous n'êtes pas le destinataire visé ou une personne autorisée à lui remettre ce courriel, vous êtes par la présente avisé qu'il est strictement interdit d'utiliser, de copier ou de distribuer ce courriel, de dévoiler la teneur de ce message ou de prendre quelque mesure fondée sur l'information contenue. Vous êtes donc prié d'aviser immédiatement l'expéditeur de cette erreur et de détruire ce message sans garder de copie.




    24 replies

    1-Visitor
    April 18, 2011
    "to BE mildly error-prone."

    Must be Monday.

    Steve Thompson
    +1(316)977-0515
    1-Visitor
    April 18, 2011
    Arbortext's "bugsave" function seems to gather up all of the entities so you can send your doctype to Arbortext support. You might try that and see what you get.
    April 18, 2011
    Is this XML or SGML?

    I do know our current CMS software will expand all entities (including char ent declarations) when you export a DTD that was imported with parameter entities...
    18-Opal
    April 18, 2011
    If it's an XML DTD, you might be able to use this tool to do the job:
    1-Visitor
    April 18, 2011
    Thank you, Ed (in your separate reply) for the 'bugsave' idea. We'll investigate using that.

    Clay and Jason, sending these ideas to a couple of folks. One 'runs' our CMS and the other can address whether we'll be allowed (by internal rules) to use this 'free' software.

    As usual, plenty of help here. Thank you!

    I'll let you know how/whether one of these succeeds.

    Steve Thompson
    +1(316)977-0515
    1-Visitor
    April 18, 2011
    Sorry, Jason, should have said, they are XML DTDs. That not that I see where that should matter. An XML DTD is the same internal structure as an SGML. At least, as far as I know...

    Steve Thompson
    +1(316)977-0515
    April 18, 2011
    I know, it's more that the available toolset for XML is much more "robusto" than SGML tools. There's still plenty of SGML tools out there, but pretty stagnant as far as development goes.

    And I've tried using some XML tools on SGML DTDs. Between tag minimization, comments, mixed content model issues, and inclusions/exclusions, sometimes that square peg isn't as square as it looks... 😉

    -Jason
    1-Visitor
    April 18, 2011
    bugsave I beleive just flattens the document instance (doc_flatten again)
    and then gives you a copy of your custom directories. I don't think it
    does anything special to the custom folders either, you get a direct copy
    of all the contents.

    Another approach although probably a little riskier is to use a schema
    converter. I beleive it will make one large schema file for you (assuming
    you are working with XML and not SGML DTDs). I know this exists in tools
    like XMLSpy, not sure about schema to DTD tools to get it back out as a
    DTD. XMLSpy may do that as well.

    ..dan

    > Thank you, Ed (in your separate reply) for the 'bugsave' idea. We'll
    > investigate using that.
    >
    > Clay and Jason, sending these ideas to a couple of folks. One 'runs' our
    > CMS and the other can address whether we'll be allowed (by internal rules)
    > to use this 'free' software.
    >
    > As usual, plenty of help here. Thank you!
    >
    > I'll let you know how/whether one of these succeeds.
    >
    > Steve Thompson
    > +1(316)977-0515
    >
    1-Visitor
    April 18, 2011
    Basic problem starts with the fact that DTDs are their own format. Then as
    Jason points out there are things in SGML DTDs that are not recognized by
    XMl parsers.

    Do you really need it to flatten the DTD or do you just want to make sure
    you have all the files? Seems like a simple Perl script might be written
    to gather up all the files - just depends on how complicated you
    environment is. I'm assuming your entities are in a directory separate
    from the DTD and that the entities will most likely reference other
    entites, so lots of nesting.

    If you can find a copy of an old tool called Near and Far it would do the
    job for you.

    ..dan


    > I know, it's more that the available toolset for XML is much more
    > "robusto" than SGML tools. There's still plenty of SGML tools out there,
    > but pretty stagnant as far as development goes.
    >
    > And I've tried using some XML tools on SGML DTDs. Between tag
    > minimization, comments, mixed content model issues, and
    > inclusions/exclusions, sometimes that square peg isn't as square as it
    > looks... 😉
    >
    > -Jason
    >
    1-Visitor
    April 18, 2011
    I am not sure about how bugsave works. In any case it is now called appsave (Tools menu->Save application). See Help 21 and Help 1418.