You are viewing a plain text version of this content. The canonical link for it is here.
Posted to general@xml.apache.org by Steve Chervitz <sa...@neomorphic.com> on 2000/06/01 21:40:17 UTC

Stylebook question and make docs trouble

I noticed that the Stylebook system allows for the specification of
URLs using a custom protocol or namespace as in:

  [StyleBook] Project URL: "sbk:/sources/docs-book.xml"

I would like to use a similar mechanism with Xerces-J for specifying
the location of an external DTD within an XML document so that I could 
do something like this:

  <?xml version="1.0" ?>
  <!DOCTYPE foo SYSTEM "myapp.home:/dtd/Foo.dtd"> 

This would require my application to resolve "myapp.home:" to the
currently installed location of my application, which contains a copy
of the DTD in a subdirectory, and then pass the complete path to
Xerces-J so that it can read the DTD and validate the document.

Is anything like this possible within Xerces-J?

The aim here is to avoid having to encode relative or absolute file
paths or http URLs in the doctypes of all of the XML files that are
shipped with or used by the application. 

-----------
Other issue:  I'm having trouble with the make docs target in the
Xerces-J 1.0.3 distribution. My tools/ directory contains all of the
jar files required in the classpath. Here's my make docs output:

$ make docs
Building Stylebook docs in docs directory
mkdir -p  docs/html
java -classpath "./src:./samples:./tools/stylebook-1.0-b2.jar:./tools/xalan-0.19.2.jar:./tools/xerces-1.0.1.jar:" org.apache.stylebook.StyleBook "targetDirectory=docs/html" docs/do
cs-book.xml tools/style-apachexml.jar
[StyleBook] Overriding targetDirectory="docs/html" (Old=".")
[StyleBook] Project URL: "sbk:/sources/docs-book.xml"
[BasicEngine] Initializing
[Loader] Parsing Project file
[XalanProcessor] Applying XSL sheet "sbk:/style/stylesheets/book2project.xsl"
[Loader] Caught java.util.zip.ZipException
[StyleBook] Caught org.apache.stylebook.LoadingException
org.apache.stylebook.LoadingException: error in opening zip file
        at org.apache.stylebook.Loader.load(Loader.java:61)
        at org.apache.stylebook.StyleBook.getProject(StyleBook.java:121)
        at org.apache.stylebook.StyleBook.main(StyleBook.java:85) 
[StyleBook] Error creating project
make: *** [docs] Error 3    


Which zip file is causing the trouble? I noticed that book2project.xsl
is located in stylesheets/book2project.xsl within the
style-apachexml.jar file. I tried putting it into
style/stylesheets/book2project.xsl, but I get the same error.

Thanks in advance for the help,

Steve Chervitz
sac@neomorphic.com








Re: Stylebook question and make docs trouble

Posted by Andy Clark <an...@apache.org>.
Steve Chervitz wrote:
>   <!DOCTYPE foo SYSTEM "myapp.home:/dtd/Foo.dtd">

I would recommend highly that you DO NOT create a new protocol.
Instead, just use a uniquely assigned URI and register an
EntityResolver with the parser that does the resolution.

There are numerous posts in the archives regarding this feature.

-- 
Andy Clark * IBM, JTC - Silicon Valley * andyc@apache.org