Project

Profile

Help

Saxon, Xerces & Validation

Added by Anonymous over 18 years ago

Legacy ID: #3310057 Legacy Poster: PeterK (mazdermind)

Hello out there Maybe I'm a little foolish, but after two days of searching I didnt find a answer on my (like it seems to me ) very simple problem. what i have are some docbook xml-files which are linked to each others by xincludes. now i'm going to parse these files over the docbook xsls with saxon from the commandline, but using xerces as xml-parser. so far so good, but what's missing is the validation against the docbook dtd. is it possible to do the validation in one step with the transformation, and how do i tell saxon on the commandline to use xerces' validation-feature? If this is not possible - is there a way of first validating these documents with xerces, and then transforming them? (i know.. i better should post this in the xerces mailinglist..) i already read about the problems described in "<a href="http://www.sagehill.net/docbookxsl/ValidXinclude.html&quot;&gt;Validating with XIncludes</a>" and i plan to use the xincluder for first resolving the xincludes and then validating/transforming the result - but first i'd like to get the validator working... Thanks for all hints and greetings from Germany, Peter


Replies (5)

Please register to reply

SaxonB8-5 &amp; DocBook - Added by Anonymous over 18 years ago

Legacy ID: #3310399 Legacy Poster: PeterK (mazdermind)

hi there okay - it was my fault - mea culpa... Now i tried SaxonB 8.5 and i got two questions on using it with the docbook-xsls: 1. i used the -novw flag to suppress the warning, that the docbook xsls are only XSLT1.0 - but will there be any problem because of that? 2. Saxon is trying to validate my stylesheet, but follwing bugreport 1093452 (https://sourceforge.net/tracker/index.php?func=detail&amp;aid=1093452&amp;group_id=29872&amp;atid=397617) this bug should have been fixed in SaxonB 8.5?!? another thing is that the docbook-extensions are not compatible zu SaxonB8.5, but this is an docbook-question and i will look there for a solution. Greetings, Peter

RE: Saxon, Xerces &amp; Validation - Added by Anonymous over 18 years ago

Legacy ID: #3311177 Legacy Poster: Michael Kay (mhkay)

You can invoke DTD validation from the Saxon command line using the -v option. The only effect of the -novw warning is to suppress the warning message that you are using a 1.0 stylesheet. The only reason that Saxon produces this warning is that the spec requires it. I can confirm 1093452 is fixed in 8.5: what symptoms are you seeing? Michael Kay

RE: Saxon, Xerces &amp; Validation - Added by Anonymous over 18 years ago

Legacy ID: #3311457 Legacy Poster: PeterK (mazdermind)

Okay.. First - with Saxon 6 everything works fine, except that i have no validation. if there is /any/ way to get validation working (e.g with a standalone validator), Saxon 6 seems to be the better choice. So i tried SaxonB 8.5. What i am calling is for example this: -- java -cp "C:\Programme\DocBookSystem\saxonb8-5\saxon8.jar" net.sf.saxon.Transform -novw -v ".\index.xml" "C:\Programme\DocBookSystem\docbook-xsl-1.69.1\xhtml\onechunk.xsl" [lot of docbook-stylesheet parameters] -- Results are some messages like -- Recoverable error on line 4 column 16 of file:/C:/Programme/DocBookSystem/docbook-xsl-1.69.1/xhtml/chunk.xsl: SXXP0003: Error reported by XML parser: Document is invalid: no grammar found. Recoverable error on line 4 column 16 of file:/C:/Programme/DocBookSystem/docbook-xsl-1.69.1/xhtml/chunk.xsl: SXXP0003: Error reported by XML parser: Document root element "xsl:stylesheet", must match DOCTYPE root "null". -- and finally -- Don't know how to chunk with SAXON 8.5 from Saxonica Processing terminated by xsl:message at line 40 -- i think this is a message from docbook (docbook-xsl-1.69.1) that wans to say "i dont like this processor...". Next i tried Saxon 7.9.1. What i was calling this time was something like -- java -cp "C:\Programme\DocBookSystem\saxonb8-5\saxon7.jar" net.sf.saxon.Transform -v ".\index.xml" "C:\Programme\DocBookSystem\docbook-xsl-1.69.1\xhtml\onechunk.xsl" [lot of docbook-stylesheet parameters] -- what shows something like -- Warning: at xsl:when on line 216 of file:/C:/Programme/DocBookSystem/docbook-xsl -1.69.1/common/table.xsl: Less-than and greater-than comparisons between strings have changed since XPat h 1.0 Error on line 2 column 16 of file:/C:/Programme/DocBookSystem/docbook-xsl-1.69.1 /common/l10n.xsl: Error reported by XML parser: Document is invalid: no grammar found. Error on line 2 column 16 of file:/C:/Programme/DocBookSystem/docbook-xsl-1.69.1 /common/l10n.xsl: Error reported by XML parser: Document root element "xsl:stylesheet", must mat ch DOCTYPE root "null". Error at choose on line 108 of file:/C:/Programme/DocBookSystem/docbook-xsl-1.69 .1/common/labels.xsl: Cannot convert string {I} to a double Transformation failed: Run-time errors were reported -- So this seems not to work neither. another thing is, that some features like automatic linenumbering or text insertation requires an extension from the docbook xsls - and this extension is only available up to saxon saxon653. So if there is /ANY/ way to get some validation into my docbook-files, i would prefer to use saxon 6. Or i have to change to xalan, but then i had to rewrite all my scripts... Thanks for your advertence, Peter

RE: Saxon, Xerces &amp; Validation - Added by Anonymous over 18 years ago

Legacy ID: #3311476 Legacy Poster: Michael Kay (mhkay)

It looks as if -v is still requesting DTD validation, not for the principal stylesheet module, but for other modules loaded using xsl:include and xsl:import. I'll look into that. The question of which Saxon versions are supported by which DocBook releases is one that's best asked on the DocBook list. Although Saxon 6.5.4 doesn't give you any way to request DTD validation from the command line, you can do it from the Java API: supply a SAXSource as the input, containing an XMLReader in which the property that requests validation has been set. Michael Kay http://www.saxonica.com/

RE: Saxon, Xerces &amp; Validation - Added by Anonymous over 18 years ago

Legacy ID: #3311574 Legacy Poster: PeterK (mazdermind)

Your explanation seems reasonable. It seems that there is only compatibility with saxon6.. i think i find another way of validating my files.. I must admit that i don't have any experience with java and so cant do anything like compiling own classes or something like that.. Peter

    (1-5/5)

    Please register to reply