DtdAnalyzer question

37 views
Skip to first unread message

Breena Krick

unread,
Oct 18, 2012, 10:42:17 AM10/18/12
to dtdan...@googlegroups.com

My co-worker and I downloaded the zip file today and installed it onto our windows environment. We were able to get it running for the dtdanalyzer.bat file. However, we noticed that there wasn’t a dtdcompare.bat file. Will that be coming in a newer release? Or do we need to create our own?

Chris Maloney

unread,
Oct 18, 2012, 10:48:17 AM10/18/12
to dtdan...@googlegroups.com
Thanks for the question, Breena,

We had hoped to get this command-line script done before the
conference, too, in addition to dtdanalyzer and dtddocumentor. See
GitHub issue #5 (https://github.com/NCBITools/DtdAnalyzer/issues/5).

Demian showed a command-line in his slides to get the comparison
output -- which isn't in the draft version of the slides that I have.
Demian -- will that work for her? Could you put the slides up on
slideshare, or send them to the list? (I think google groups supports
attachments, but I'm not sure).

Anyways, the answer is that, right now, you have to run dtdanalyzer
twice, once for each DTD, and then run them through the stylesheet
xslt/compare-dtds.xsl in order to produce the output. Let me know if
you need me to fill in more details.

Chris
> --
> You received this message because you are subscribed to the Google Groups
> "DtdAnalyzer" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/dtdanalyzer/-/lx4MebMmN-sJ.
> To post to this group, send email to dtdan...@googlegroups.com.
> To unsubscribe from this group, send email to
> dtdanalyzer...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/dtdanalyzer?hl=en.

Demian Hess

unread,
Oct 18, 2012, 11:35:21 AM10/18/12
to dtdan...@googlegroups.com
Unfortunately, running the comparison report is tedious because it has not yet been fully integrated into the current dtdAnalyzer project.

I have always made the reports just as Chris sketches out by getting XML representations for both DTDs and then running an XSLT 1.0 transform on one of the documents and passing in the location to the second as a parameter.

Assuming I have DTDv1.dtd and DTDv2.dtd, as well as the .NET version of Saxon HE installed, the full procedure would be:

1) dtdanalyzer -x DTDv1.dtd dtd1.xml
2) dtdanalyzer -x DTDv2.dtd dtd2.xml
3) transform.exe -xsl:compare-dtds.xsl -s:dtd1.xml -o:report.html dtd2-loc=dtd2.xml dtd1-name="DTD version 1"
 dtd2-name="DTD Version 2"

The third step "should" convert dtd1.xml using the compare-dtds.xsl and output an html file named report.html.
--
Demian Hess

Avalon Consulting, LLC
527 Maple Avenue East, Suite 200, Vienna, VA 22180

Mobile: 301-943-8307
Fax: 845-367-5496
he...@avalonconsult.com



Demian Hess

unread,
Oct 18, 2012, 11:36:19 AM10/18/12
to dtdan...@googlegroups.com
Whoops, and of course I made a typo--switch the "-x" option to "-s":
1) dtdanalyzer -s DTDv1.dtd dtd1.xml
2) dtdanalyzer -s DTDv2.dtd dtd2.xml

3) transform.exe -xsl:compare-dtds.xsl -s:dtd1.xml -o:report.html dtd2-loc=dtd2.xml dtd1-name="DTD version 1"
 dtd2-name="DTD Version 2"

Breena Krick

unread,
Oct 18, 2012, 1:02:42 PM10/18/12
to dtdan...@googlegroups.com
Hey thanks Demian. I was able to successfully run the compare-dtds.xsl on the command line in my Windows environment to create an html output file showing the differences between the JATS v1.0 and the NLM v3.0 DTDs. It's pretty cool.

Maloney, Christopher (NIH/NLM/NCBI) [C]

unread,
Oct 18, 2012, 1:07:05 PM10/18/12
to dtdan...@googlegroups.com

Hey, Breena, I see that you were successful.  Your email arrived just when I was getting ready to send the message below.  I’ll still send it along, in case it might be useful.

 

-----------------

Yes, this is pretty tedious, and we’ll clean it up as soon as we get a few spare cycles.

 

Breena, you could also run this straight from the dtdanalyzer, with two commands.  The first pass processes DTDv2, and the second pass does two things:  processes DTDv1, and then runs the comparison stylesheet.

 

Note that specifying the file locations is tricky.  The most sure-fire way is to specify the absolute paths, for now.  In the example below, substitute the path where you’ve put the dtdanalyzer (in the value for “-x”) and the path where your currently working (in the value for “-P dtd2-loc”).

 

For Windows, this works:

 

dtdanalyzer -s DTDv2.dtd DTDv2.daz.xml

dtdanalyzer -s DTDv1.dtd ^

    -x M:\git\NCBITools\DtdAnalyzer\xslt\compare-dtds.xsl ^

    -P dtd2-loc=file:///M:/temp/daztest/DTDv2.daz.xml ^

    -P dtd1-name="DTD version 1" ^

    -P dtd2-name="DTD Version 2" > comparison-report.html

 

For Unix, the same thing would be:

 

dtdanalyzer -s DTDv2.dtd DTDv2.daz.xml

dtdanalyzer -s DTDv1.dtd \

    -x /home/maloneyc/git/NCBITools/DtdAnalyzer/xslt/compare-dtds.xsl \

    -P dtd2-loc=file:///home/maloneyc/temp/daztest/DTDv2.daz.xml \

    -P dtd1-name="DTD version 1" \

    -P dtd2-name="DTD Version 2" > comparison-report.html

 

Let us know if it doesn’t work for you.

 

Chris Maloney

NIH/NLM/NCBI (Contractor)

Building 45, 5AN.24D-22

301-594-2842

Breena Krick

unread,
Oct 18, 2012, 2:57:05 PM10/18/12
to dtdan...@googlegroups.com, malo...@ncbi.nlm.nih.gov
I tried the below in Windows and it works too. I haven't had a chance to try all this out in unix but when I do, I'll let you know how it goes.

Thanks a lot for your help today.

-Breena

Demian Hess

unread,
Oct 18, 2012, 3:08:39 PM10/18/12
to dtdan...@googlegroups.com
Success!

To view this discussion on the web visit https://groups.google.com/d/msg/dtdanalyzer/-/jkOdgZczikwJ.

To post to this group, send email to dtdan...@googlegroups.com.
To unsubscribe from this group, send email to dtdanalyzer...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/dtdanalyzer?hl=en.
Reply all
Reply to author
Forward
0 new messages