cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

"Flattening" a DTD

steve.thompson4
1-Newbie

"Flattening" a DTD

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 24

"to BE mildly error-prone."

Must be Monday.

Steve Thompson
+1(316)977-0515

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.

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...

If it's an XML DTD, you might be able to use this tool to do the job:

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

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

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

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
>

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
>

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.

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

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

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

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
>

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.

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

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).

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

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


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

Bill,
Our installation media do not include that app. But then, we're still using 5.2 on our PC workstations, so maybe it's something included in later versions.

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

Steve,



Here is a snapshot from Epic version 5.1, and it is the same on 5.3 so I assume it would be there for 5.2 also.



[cid:image001.png@01CBFE72.132E2830]



-Andy



\ / Andy Esslinger LM Aero - Tech Order Data

_____-/\-_____ (817) 279-0442 1 Lockheed Blvd, MZ 4285

\_\/_/ (817) 777 3047 Fort Worth, TX 76108-3916


Steve,


Near and Far has been gone for sometime. I used to have a copy that worked great for SGML (must be smart to inclusions/exclusions and tag omission control), however no longer works on recent versions ofWindows.


I have a manual process, probably no different than anyone else, so it's tedious. However, just as someone already mentioned, you have to add the human factor for errors.


I've gone to the link that Gareth provided and you end up 'registering' on their site (in Germany) with a minimum of your last name, e-mail address and whether or not you want to participate in their e-mail listing. Then, they send you a link to the zip file so you can download it. So far, I'm onboard, but I have to wait until I get home to try it out since I'm not putting any 'free' software on my company's computer/network.


I've also seen (through searches) some references to a program run through Perl, but could never get it to work.


Assuming you still use the cut-back version of CPA, you know how many fragments the DTD sets are broken upinto. The initial 25 for CPA are now about 44 for me, all based on the 38784 (or variation to it). I am constantly flattening the DTD's and it takes me about a hour or so to get one done. A pain to say the least. I use a tool called "Search & Replace" by Funduc Software that does a lot of the work, followed by using TextPad to finish it up. The output is fairly decent for reading.


Take care, and hope this helps some,


Bob

So we finally got clearance to do a test install of Turbo XML. Good that far.

Someone on here said they had to point it to the entity locations. I'm sure that was 'intuitive' for them, since the documentation and reviews all seem to describe it that way, but it hasn't fit my intuition yet.

Or maybe I misunderstood.

In any case, having difficulty getting it to see the location of the files referenced by our parameter entities. We're using entries that depend on the public ids being found using a catalog. Doesn't look like that's acceptable, but also haven't found where to give it the path to our 'DTDents' folder.

Currently blaming sinusitis for my mental density,
Steve Thompson
+1(316)977-0515
Announcements