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
    Steve,
    You mentioned that you tried Architect, but did you try XML Authority which is a third party DTD/schema editor that comes with Architect. I've only used it to 'validate' authoring customizations made to our customer provided DTD. This DTD does contain entities and if I move one from its defined location on the file system I get errors, but I've never tried to flatten the DTD.

    -Bill
    1-Visitor
    April 18, 2011
    Ed,

    OK, that sounds familiar. I have used appsave to send a doctype to PTC TS. Grabs a large number of files.

    If push comes to a really hard shove, that would at least provide the file structure in order to indicate the particular doctype was using the entities.

    Still hoping to find something to automate flattening the DTD itself.

    But Thanks! I'll keep this in mind...
    Steve Thompson
    +1(316)977-0515
    1-Visitor
    April 18, 2011
    Dan,
    We looked at XMLSpy. Don't really trust the double conversion. But haven't actually tested it, yet, so that might still be a candidate.

    Thanks,
    Steve Thompson
    +1(316)977-0515
    1-Visitor
    April 18, 2011
    Be careful with the settings in XMLSpy. It probably won't matter for a
    DTD, but using XMLSpy by some of our devs introduced whitespace characters
    for indentation formatting that led to undesirable whitespace.

    Typically, whitespace between tags is OK in XML, but we have a situation
    where some of our tags generate punctuation, and whitespace formatting
    caused periods, commas, etc to have a space before them.

    keith

    On Mon, Apr 18, 2011 at 2:16 PM, EXT-Thompson, Steve <
    steve.thompson2@boeing.com> wrote:

    > Dan,
    > We looked at XMLSpy. Don't really trust the double conversion. But haven't
    > actually tested it, yet, so that might still be a candidate.
    >
    > Thanks,
    > Steve Thompson
    > +1(316)977-0515
    >
    1-Visitor
    April 18, 2011
    XMLSpy tends to want to save documents in prettyprint format, too ( I think this is the same "indentation formatting" as mentioned below). As noted, this can cause whitespace issues.
    1-Visitor
    April 18, 2011
    Keith, Ed,
    Thanks for the caution. Yes, XMLSpy does provide that formatting almost too easily. Works really well for making an XSLT or DTD readable, but we've also seen the problems with XML processed thru it.

    Looking into the other third-party possibilities mentioned.

    Steve Thompson
    +1(316)977-0515
    16-Pearl
    April 18, 2011
    This is slightly off topic but this thread reminded me of a DTD tool we
    sometimes use called TreeVision - has anyone else used that? It's a really
    neat way of visualising a DTD with all the parameter entities etc. resolved,
    and without having to convert to Schema first (I'm looking at you, Oxygen).

    1-Visitor
    April 19, 2011
    It works well, I don't use it much as I'm used to
    using Near and Far. The Turbo XML is a good tool
    as well. I actually prefer some of its features
    for browsing a DTD because you can see the content model as text and graphics.

    ..dan

    1-Visitor
    April 19, 2011
    Hi Steve,



    If you can find a copy of Microstar Software Ltd. "Near & Farยฎ Designer" which was an application from 1993-1998 it will "flatten" a DTD in the manner you suggest. It works with SGML and XML. However, it's getting old. I've included a picture of an S1000D issue 3 SGML DTD for your reference so you can see what it looks like. I had to point out to Near & Far Designer where the catalog was before it would open it. If you "save as" you can save a DTD to another location and it appears to flatten the file in the manner you are looking for, i.e. all the notations etc. would be included.



    The primary purpose of this software was to create and edit DTDs.



    I've also manually looked into a DTD and manually copied all the external notations etc. into it, which is a long but rewarding process if you have the patience to see it through.



    Greg


    1-Visitor
    April 19, 2011
    Greg (and Dan),
    Thanks for the suggestion. Would like to try it, but could only find sites that reference other download locations (Google and Yahoo searches). Doesn't appear to be available anywhere, now.

    Did find a few, very old forum threads that discussed it, but again, nothing in the way of a copy, even for testing purposes.

    Thanks anyway,
    Steve Thompson
    +1(316)977-0515