new user
Added by Anonymous over 17 years ago
Legacy ID: #4240669 Legacy Poster: krishnan (rsk_home)
Hi all, I am new to Saxon, Now I am reading "XSLT 2.0 Programmer's Reference, Third Edition" in this as per the Author's recommendation. I am trying to use "Saxon" it works but not as per the Author's suggestion i.e. In his book he mentioned that if we place the "saxon" folder in "c:\saxon" we have to create "data" folder as a subfolder for saxon and we will place our xml and xslt files in that folder and in the command prompt we will type as per below java -jar c:\saxon\saxon8.jar sample.xml sample.xsl but in my case it only accepts as below java -jar c:\saxon\saxon8.jar c:\saxon\data\sample.xml c:\saxon\data\sample.xsl As same as if i have a XML file with "DOCTYPE" type declaration. it will not accept the dtd path I mentioned in that file. for e.g. in my xml file if "Doctype declaration" is as follows: <!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.2 20060430//EN" "L:/xml/nlm/Entities/journalpublishing.dtd"> when i run saxon command in the command prompt it shows error message as follows: C:> java -jar c:\saxon\saxon8.jar c:\saxon\data\gam005.xml c:\saxon\data\gam005.xsl >c:\saxon\data\krish2.htm Warning: at xsl:stylesheet on line 1 of file:/c:/saxon/data/gam005.xsl: Running an XSLT 1.0 stylesheet with an XSLT 2.0 processor Error on line 2 of file:/c:/saxon/data/gam005.xml: SXXP0003: Error reported by XML parser: External entity not found: "L:/xml/nlm/Entities/journalpublishing.dtd".: unknown protocol: l Transformation failed: Run-time errors were reported Process java exited with code 2 My Operating System is windows 2000 professional system variables I have defined the following Variable=path value=c:\saxon; Please anybody can resolve my problem? Regards, Srikrishnan
Replies (4)
Please register to reply
RE: new user - Added by Anonymous over 17 years ago
Legacy ID: #4240846 Legacy Poster: Michael Kay (mhkay)
The command java -jar c:\saxon\saxon8.jar sample.xml sample.xsl will work so long as your current working directory is c:\saxon\data. This follows the normal conventions for use of filenames on the command line. You can set the current working directory using the "cd" command. Your DOCTYPE declaration <!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.2 20060430//EN" "L:/xml/nlm/Entities/journalpublishing.dtd"> is not legal XML. Many XML parsers (unfortunately) will accept it, but it seems you are using one that doesn't. Note that the XML parser is not part of Saxon itself, that's why Saxon is careful to tell you that the error message comes not from Saxon itself, but from the XML parser. You are probably using the default parser that comes with the JDK, which is Crimson or Xerces depending on which JDK version you are using. The reason the declaration isn't legal is that the system identifier of the DTD is required to be a URI, but you have provided a Windows filename. Change it to "file:///L:/xml/nlm/Entities/journalpublishing.dtd" Michael Kay http://www.saxonica.com/
RE: new user - Added by Anonymous over 17 years ago
Legacy ID: #4250679 Legacy Poster: krishnan (rsk_home)
Hi Michael Kay, I am very happy to hear reply from you. Thanks for your response. It works perfectly. Your Book is very userfriendly and I am very happy to learn from this. I have another doubt. I am a Template Developer (Typesetting) in 3B2 software. In that we are using LibXML parser. Actually the "DOCTYPE" declaration is as follows: <!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.2 20060430//EN" "journalpublishing.dtd"> In 3B2 it accepts "catalog" file to mention the dtd path.But in saxon, I am not able to find the method of using "catalog" so that I have tried the below option: <!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v2.2 20060430//EN" "L:/xml/nlm/Entities/journalpublishing.dtd"> But now as per your suggestion it works fine. But I want to use "catalog" instead of violating XML rules. Can you help me in this regard? Regards, Srikrishnan
RE: new user - Added by Anonymous over 17 years ago
Legacy ID: #4250819 Legacy Poster: Michael Kay (mhkay)
There's some information here: http://www.dpawson.co.uk/docbook/catalogs.html about the use of Oasis catalogs with Saxon. (Remember though that some of it relates to Saxon6, so you may need to change com.icl.saxon.StyleSheet to net.sf.saxon.Transform). Another useful link is: http://xml.apache.org/commons/components/resolver/resolver-article.html#s.using.catalogs If that doesn't help Google for "Oasis catalogs with Saxon".
RE: new user - Added by Anonymous over 17 years ago
Legacy ID: #4252202 Legacy Poster: krishnan (rsk_home)
Thanks Michael Kay, For your valuable suggestions Best Regards, Srikrishnan
Please register to reply