Register  Login       Search  
Forum  
 
  
 
Forum  Forum     
 
SearchForum Home
  XML Lab Products  nxslt  nxslt2 and DTD...
 nxslt2 and DTD
 
dj_dick
2 posts
Joined
4/20/2006

nxslt2 and DTD
Posted: 20 Apr 06 3:23 AM (Czech Republic)
Hello,

when I try to process a file using nxslt2, I get this error message:

An error occurred while compiling stylesheet 'file:///E:/Manuals/xsl/html_cz.xsl
': System.Xml.Xsl.XslLoadException: XSLT compile error. ---> System.Xml.XmlException: DTD is prohibited in this XML document.

I've read somewhere that DTDs are disabled by default for security reasons. But how to enable them?

Thanks,
Richard
olegt
85 posts
www.xmllab.net
Joined
2/25/2005

Re: nxslt2 and DTD
Posted: 21 Apr 06 12:52 PM (N/A)
Hmmmm, I can't reproduce the problem. Make sure you are using nxslt2 v2.0.1 and if so provide more information please, a minimal sample would be great.
Oleg Tkachenko, Microsoft MVP for XML, MCPD
http://www.XmlLab.Net | http://blog.tkachenko.com
dj_dick
2 posts
Joined
4/20/2006

Re: nxslt2 and DTD
Posted: 24 Apr 06 11:55 PM (Czech Republic)
Yes, I have nxslt2.exe version 2.0.1.
I'm testing it with the standard DocBook XSLT stylesheets (http://sourceforge.net/project/showfiles.php?group_id=21935#files, the "docbook-xsl" package, version 1.69.1). These stylesheets work OK with another XSLT processors like Saxon or xsltproc.

Let's assume that the XSLTs are unpacked into the "docbook" subdirectory, then I call:

nxslt2.exe testmanual-en.xml docbook/html/docbook.xslt

(where testmanual-en.xml is my test file - I'll send it to you by email)
and I get the following error message:

An error occurred while compiling stylesheet 'file:///E:/Manuals/xsl/styles/html
/docbook.xsl': System.Xml.Xsl.XslLoadException: XSLT compile error. ---> System.
Xml.XmlException: DTD is prohibited in this XML document.


olegt
85 posts
www.xmllab.net
Joined
2/25/2005

Re: nxslt2 and DTD
Posted: 25 Apr 06 5:07 AM (Israel) Modified By olegt  on 4/25/2006 5:08:37 AM)

That's a problem with XInclude and stylesheet which includes another one having Doctype declaration. When loading such stylesheet via custom XmlReader (XIncludingReader in this case) XslCompiledTransform prohibits DTD. I believe that's a bug.

Anyway, temporary workaround is to turn off XInclude support (-xi option).

I found a solution and will fix this problem in the next release.


Oleg Tkachenko, Microsoft MVP for XML, MCPD
http://www.XmlLab.Net | http://blog.tkachenko.com
olegt
85 posts
www.xmllab.net
Joined
2/25/2005

Re: nxslt2 and DTD
Posted: 20 Jun 07 5:12 AM (Israel)
OK, DTD and XInclude don't play well together in .NET. Just turn off XInclude using -xi option.
Oleg Tkachenko, Microsoft MVP for XML, MCPD
http://www.XmlLab.Net | http://blog.tkachenko.com
  XML Lab Products  nxslt  nxslt2 and DTD...
Forum Home  Search