SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    Aug 2004
    Location
    US
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using Xalan and DTDs

    I'm attempting to use the xalan command line utility to generate html from xml with a specific xsl stylesheet. The problem is, the xml files I use point to a dtd with a relative path (found by Epic), so when I run xalan, it tries to find the dtd in the xml file's folder and fails. If I change the dtd in the file, it works, but there are hundreds of files and they can't all be changed. Is there a way to point to a particular dtd with the xalan command line? Here's an example of the error I get when I don't change the xml:

    java org.apache.xalan.xslt.Process -in c:\test\crp11nixie000000.xml -xsl s:\xml\doctypes\fcdit-etm\fcdit-etm.html.xsl -out c:\test\crp11nixie000000.htm -html

    (Location of error unknown)XSLT Error (javax.xml.transform.TransformerException): java.io.FileNotFoundException: C:\test\fcdit-etm.dtd (The system cannot find the file specified)

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Why can't you move the .dtd file to where it needs to be?

  3. #3
    SitePoint Member
    Join Date
    Aug 2004
    Location
    US
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by vgarcia
    Why can't you move the .dtd file to where it needs to be?
    The xml files are spread out over many directories and are brought in separately for every project. Therefore, the DTD would have to be placed in every directory every time the files are brought in. There has to be a more efficient way.

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,235
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    As far as I know there's no way to set the DTD from a command-line option. If you're clever enough you can write a batch file or shell script to copy the DTD into every directory you need to though

  5. #5
    SitePoint Member
    Join Date
    Aug 2004
    Location
    US
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up

    Quote Originally Posted by vgarcia
    As far as I know there's no way to set the DTD from a command-line option. If you're clever enough you can write a batch file or shell script to copy the DTD into every directory you need to though

    Actually, I was talking to a co-worker and we were thinking that, being that the whole process is driven by a Java app, we would do exactly that, have the Java call a script file that puts the DTD in a directory, creates the html, then deletes the DTD. Thanks for your help.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •