Sounds good!
Next problem(s):
1) When errors are detected, the if statement doesn't drop us down to the
"Errors found" message. Errors from xmllint still appear on the console though.
2) A bunch of the books don't validate. I wrote a script to validate all the
directories, and the results are below. All the ones that don't validate need
to be chased down....any volunteers?
bash-3.00$ ./common/validateall
TRSOLTRANS.book
validating ./TRSOLTRANS...
No validation errors found in TRSOLTRANS.book .
SYSADV3.book
validating ./SYSADV3...
No validation errors found in SYSADV3.book .
SOLARISINSTALL.book
validating ./SOLARISINSTALL...
No validation errors found in SOLARISINSTALL.book .
SYSADPRTSVCS.book
validating ./SYSADPRTSVCS...
No validation errors found in SYSADPRTSVCS.book .
SYSADV4.book
validating ./SYSADV4...
No validation errors found in SYSADV4.book .
LOGVOLMGRADMIN.book
validating ./LOGVOLMGRADMIN...
No validation errors found in LOGVOLMGRADMIN.book .
DTRCUG.book
validating ./DTRCUG...
DTRCUG.book:17: validity error : NOTATION PS is not declared
<book id="dtrcug" label="fcs" lang="en"><title>DTrace User Guide</title><bookinf
^
abstract.xml:1: validity error : NOTATION PS is not declared
<para>This book serves as an introduction to the dynamic tracing capabilities
^
legal.xml:1: validity error : NOTATION PS is not declared
<para>Sun Microsystems, Inc. has intellectual property rights relating to techno
^
fr-legal.xml:1: validity error : NOTATION PS is not declared
<para lang="fr"></para><para>Sun Microsystems, Inc. détient les droits de
^
preface.xml:1: validity error : NOTATION PS is not declared
<preface id="gcfba"><title>Preface</title><highlights><para>The <citetitle>DTrac
^
sundocs.xml:1: validity error : NOTATION PS is not declared
<sect1><title>Documentation, Support,
^
typeconv.xml:1: validity error : NOTATION PS is not declared
<sect1><title>Typographic
^
No validation errors found in DTRCUG.book .
SYSADRM.book
validating ./SYSADRM...
No validation errors found in SYSADRM.book .
ZFSADMIN.book
validating ./ZFSADMIN...
No validation errors found in ZFSADMIN.book .
TRSOLDEV.book
validating ./TRSOLDEV...
labelapi.xml:38: parser error : xmlParseEntityRef: no name
[ ! -x /bin/plabel ] && return 1
^
labelapi.xml:38: parser error : xmlParseEntityRef: no name
[ ! -x /bin/plabel ] && return 1
^
labelapi.xml:39: parser error : xmlParseEntityRef: no name
/bin/plabel > /dev/null 2>&1
^
labelapi.xml:177: parser error : chunk is not well balanced
</chapter>
^
TRSOLDEV.book:46: parser error : Failure to process entity labelapi
</bookinfo>&preface;&api-intro;&labelapi;&labelcode;&printing;&ipcapi;&windowapi
^
TRSOLDEV.book:46: parser error : Entity 'labelapi' not defined
</bookinfo>&preface;&api-intro;&labelapi;&labelcode;&printing;&ipcapi;&windowapi
^
Errors found in TRSOLDEV.book .
DRIVERTUT.book
validating ./DRIVERTUT...
No validation errors found in DRIVERTUT.book .
TRSOLLBLADMIN.book
validating ./TRSOLLBLADMIN...
No validation errors found in TRSOLLBLADMIN.book .
SOLDEVELINSTALL.book
validating ./SOLDEVELINSTALL...
No validation errors found in SOLDEVELINSTALL.book .
SOLDEVERN.book
validating ./SOLDEVERN...
No validation errors found in SOLDEVERN.book .
TRSSUG.book
validating ./TRSSUG...
No validation errors found in TRSSUG.book .
INSTALLPKGLIST.book
validating ./INSTALLPKGLIST...
No validation errors found in INSTALLPKGLIST.book .
SSMBAG.book
validating ./SSMBAG...
No validation errors found in SSMBAG.book .
SOLINSTALLPBIU.book
validating ./SOLINSTALLPBIU...
No validation errors found in SOLINSTALLPBIU.book .
SOLTUNEPARAMREF.book
validating ./SOLTUNEPARAMREF...
No validation errors found in SOLTUNEPARAMREF.book .
SYSADV5.book
validating ./SYSADV5...
No validation errors found in SYSADV5.book .
SYSADV2.book
validating ./SYSADV2...
No validation errors found in SYSADV2.book .
SOLINSTALLUPG.book
validating ./SOLINSTALLUPG...
No validation errors found in SOLINSTALLUPG.book .
SOLINSTALLFLASH.book
validating ./SOLINSTALLFLASH...
No validation errors found in SOLINSTALLFLASH.book .
SOLINSTALLADV.book
validating ./SOLINSTALLADV...
No validation errors found in SOLINSTALLADV.book .
DYNMCTRCGGD.book
validating ./DYNMCTRCGGD...
No validation errors found in DYNMCTRCGGD.book .
PACKINSTALL.book
validating ./PACKINSTALL...
PACKINSTALL.book:18: element bilioid: validity error : No declaration for
element bilioid
817-0406-11</bilioid>
^
PACKINSTALL.book:75: element info: validity error : Element info content does
not follow the DTD, expecting ((title | titleabbrev | subtitle)* , (abstract |
address | artpagenums | author | authorgroup | authorinitials | bibliocoverage
|
biblioid | bibliosource | collab | confgroup | contractsponsor | contractnum |
copyright | date | edition | editor | issuenum | keywordset | legalnotice |
mediaobject | orgname | othercredit | pagenums | printhistory | productname |
productnumber | pubdate | publisher | publishername | releaseinfo | revhistory
|
seriesvolnums | subjectset | volumenum | annotation | extendedlink | bibliomisc
| bibliomset | bibliorelation | biblioset | itermset)*), got (authorgroup
bilioid releaseinfo pubdate publisher copyright abstract legalnotice subjectset
)
</info>
^
PACKINSTALL.book:94: element book: validity error : Element book content does
not follow the DTD, expecting (((title | titleabbrev | subtitle)* , info?) ,
(glossary | bibliography | index | toc | dedication | preface | chapter |
appendix | article | colophon | part | reference)+), got (title info xi:include
xi:include xi:include xi:include xi:include xi:include xi:include xi:include
xi:include )
</book>
^
No validation errors found in PACKINSTALL.book .
MODDEBUG.book
validating ./MODDEBUG...
No validation errors found in MODDEBUG.book .
SOLINSTALLNET.book
validating ./SOLINSTALLNET...
No validation errors found in SOLINSTALLNET.book .
MTPODG.book
validating ./MTPODG...
lgrou-api.xml:48: validity error : ENTITY attribute entityref reference an
unknown entity "uma"
lity Group Schematic</title><mediaobject><imageobject><imagedata entityref="uma"
^
lgrou-api.xml:53: validity error : ENTITY attribute entityref reference an
unknown entity "numa"
ty Groups Schematic</title><mediaobject><imageobject><imagedata entityref="numa"
^
No validation errors found in MTPODG.book .
SYSADV6.book
validating ./SYSADV6...
No validation errors found in SYSADV6.book .
RSCMGRDEVGD.book
validating ./RSCMGRDEVGD...
No validation errors found in RSCMGRDEVGD.book .
SYSADV1.book
validating ./SYSADV1...
No validation errors found in SYSADV1.book .
TRSOLINSTALL.book
validating ./TRSOLINSTALL...
No validation errors found in TRSOLINSTALL.book .
SOLWHATSNEW.book
validating ./SOLWHATSNEW...
No validation errors found in SOLWHATSNEW.book .
TRSOLADMPROC.book
validating ./TRSOLADMPROC...
No validation errors found in TRSOLADMPROC.book .
FYI,
Mike
michelle olson wrote:
> Cool, this works without modification, confirmed!
>
> -Michelle
>
> Michael Pogue wrote:
>> Actually, could you try out this one? It eliminates step 3, too -- no
>> more need to edit that XML_CATALOG_FILES line. I've also added a CDDL
>> header.
>>
>> Mike
>> ================================================
>>
>> bash-3.00$ cat validate
>> #!/bin/sh
>> #
>> # CDDL HEADER START
>> #
>> # The contents of this file are subject to the terms of the
>> # Common Development and Distribution License, Version 1.0 only
>> # (the "License"). You may not use this file except in compliance
>> # with the License.
>> #
>> # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
>> # or http://www.opensolaris.org/os/licensing.
>> # See the License for the specific language governing permissions
>> # and limitations under the License.
>> #
>> # When distributing Covered Code, include this CDDL HEADER in each
>> # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
>> # If applicable, add the following below this CDDL HEADER, with the
>> # fields enclosed by brackets "[]" replaced with your own identifying
>> # information: Portions Copyright [yyyy] [name of copyright owner]
>> #
>> # CDDL HEADER END
>> #
>>
>> MYLOCATION=`pwd`/$0; export MYLOCATION
>> XML_CATALOG_FILES=`dirname $MYLOCATION`/catalog.xml; export
>> XML_CATALOG_FILES
>> #echo XML_CATALOG_FILES = $XML_CATALOG_FILES
>> if xmllint --memory --valid --noout *.book; then
>> echo No validation errors found in *.book .
>> else
>> echo Errors found in *.book .
>> fi
>>
>>
>>
>>
>>
>> michelle olson wrote:
>>
>>> Awesome! It works for me. Thank you so much Mike, I will add these
>>> two new files to common and update the instructions.
>>>
>>> -Michelle
>>>
>>> Michael Pogue wrote:
>>>
>>>> OK, here's the recipe (could somebody please try out these
>>>> instructions, to make sure everything works correctly?):
>>>>
>>>> 1) Create a "catalog.xml" file in your "common/" directory.
>>>> Michelle, we should create this file in the common/ directory, so
>>>> that this step can be eliminated.
>>>>
>>>> bash-3.00$ cat catalog.xml
>>>> <?xml version="1.0"?>
>>>> <!DOCTYPE catalog PUBLIC "-//OASIS//DTD Entity Resolution XML
>>>> Catalog V1.0//EN"
>>>> "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
>>>> <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
>>>> <public publicId="-//Sun Microsystems//DTD SolBook-XML 3.5//EN"
>>>> uri="xsolbook.dtd"/>
>>>> </catalog>
>>>>
>>>> Note that the catalog refers to "xsolbook.dtd", and not
>>>> "solbook.dtd".
>>>> No need to rename the file!!
>>>>
>>>> 2) Create the following file, called "validate" in your "common/"
>>>> directory.
>>>> Michelle, I think we should put this file in common/, too. That
>>>> would eliminate step 2.
>>>>
>>>> bash-3.00$ cat validate
>>>> #!/bin/sh
>>>> #
>>>> # Copyright 2008 Sun Microsystems, Inc. All rights reserved.
>>>> # Use is subject to license terms.
>>>> #
>>>>
>>>> XML_CATALOG_FILES=/home/myusername/docs2/20080215/common/catalog.xml; \
>>>> export XML_CATALOG_FILES
>>>> if xmllint --memory --valid --noout *.book; then
>>>> echo No validation errors found in *.book .
>>>> else
>>>> echo Errors found in *.book .
>>>> fi
>>>>
>>>> 3) Change the XML_CATALOG_FILES= statement in validate to point at the
>>>> "catalog.xml" file you created in step 1. You only have to do this
>>>> once.
>>>>
>>>> 4) cd to the directory containing the book you want to validate.
>>>>
>>>> cd /home/myusername/docs2/20080215/DYNMCTRCGGD
>>>>
>>>> 5) Run the validate command. It will validate the .book file (and
>>>> everything that the .book file includes).
>>>>
>>>> bash-3.00$ ../common/validate
>>>> No validation errors found in DYNMCTRCGGD.book .
>>>>
>>>> Mike
>>>>
>>>>
>>>> michelle olson wrote:
>>>>
>>>>> Hi Mike,
>>>>>
>>>>> OK, any help you can give on the catalogs would be greatly
>>>>> appreciated. That was my original intent, but the work hasn't been
>>>>> completed because I have no experience with XML catalogs.
>>>>>
>>>>> thanks,
>>>>> Michelle
>>>>>
>>>>> Michael Pogue wrote:
>>>>>
>>>>>> I've been thinking about that....
>>>>>>
>>>>>> I don't think the best approach is to make N copies (in this case,
>>>>>> N = 36) of the dtd and entities file. If we do that in the
>>>>>> repository, they will diverge. It would be better to keep them in
>>>>>> one place (like "common"), but have the validation script
>>>>>> reference them there.
>>>>>>
>>>>>> The best way to fix this is probably to use XML catalogs. It
>>>>>> looks like the .dtd and sun-iso files are referenced via PUBLIC
>>>>>> entities, so this should work.
>>>>>>
>>>>>> Mike
>>>>>>
>>>>>> michelle olson wrote:
>>>>>>
>>>>>>> Michael Pogue wrote:
>>>>>>>
>>>>>>>> That's better, but it still generates errors, because the
>>>>>>>> entities are actually defined elsewhere. It turns out that
>>>>>>>> copying "common/sun-iso-map.xml" to the DYNMCTRCGGD directory
>>>>>>>> does make it work the rest of the way!
>>>>>>>>
>>>>>>> OK, cool, I'm glad you've made progress, I eagerly await a push
>>>>>>> notification! :)
>>>>>>>
>>>>>>>> I verified that "xmllint --valid --noout DYNMCTRCGGD.book"
>>>>>>>> complains (correctly) when I insert validity errors into the
>>>>>>>> .book file, the sun-iso-map.xml file, and into the chapter1.xml
>>>>>>>> file. So, I think we have a validation process that works now.
>>>>>>>>
>>>>>>>> We should make it easier to use, though!
>>>>>>>>
>>>>>>> OK, so I'll put a copy of the correctly named dtd and the
>>>>>>> sun-iso-map files into each book directory in the next update of
>>>>>>> the consolidation. Then, we should update the instructions to
>>>>>>> make explicit that xmllint should be run on the book file. What
>>>>>>> else can we do to make it easier?
>>>>>>>
>>>>>>> thanks,
>>>>>>> Michelle
>>>>>>>
>>>>>>>> Mike
>>>>>>>>
>>>>>>>> michelle olson wrote:
>>>>>>>> ...
>>>>>>>>
>>>>>>>>> Thanks for continuing to work on this. I found a couple things
>>>>>>>>> that might also help Rainer. So, try doing the following:
>>>>>>>>>
>>>>>>>>> -copy the xsolbook.dtd from the 20080215/common directory to
>>>>>>>>> your DYNMCTRCGGD directory.
>>>>>>>>> -rename the xsolbook.dtd file to solbook.dtd.
>>>>>>>>> -issue the xmllint --valid --noout DYNMCTRCGGD.book
>>>>>>>>>
>>>>>>>>>
>>>>>>>> ...
>>>>>>>>
>> _______________________________________________
>> docs-discuss mailing list
>> docs-discuss at opensolaris.org
>>
>