Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 11th, 2008, 07:57 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Importing DTD file in to an xsl

Is there any way to include/import a DTD file in to an xsl file?

Thanks
Venkat

 
Old August 11th, 2008, 08:03 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

An XSLT stylesheet is XML so you can use the normal XML mechanisms like
Code:
<!DOCTYPE xsl:stylesheet SYSTEM "stylesheet.dtd">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
...
</xsl:stylesheet>

--
  Martin Honnen
  Microsoft MVP - XML
 
Old August 11th, 2008, 10:05 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Mnay Thanks, i will check this.

Quote:
quote:Originally posted by Martin Honnen
 An XSLT stylesheet is XML so you can use the normal XML mechanisms like
Code:
<!DOCTYPE xsl:stylesheet SYSTEM "stylesheet.dtd">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
...
</xsl:stylesheet>

--
Martin Honnen
Microsoft MVP - XML
 
Old August 11th, 2008, 10:18 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I want to include/import the doctype in the following way.

folder1
    folder2
       folder3

I have a xsl file at folder3 and the dtd file at folder1. I need to include the dtd (at folder1) in to the xsl file (at folder3). Can you help me in this regard. I tried this way and it did not work:

<!DOCTYPE xsl:stylesheet SYSTEM "../../stylesheet.dtd">

Thanks
Quote:
quote:Originally posted by venkatragh82
 Mnay Thanks, i will check this.

Quote:
quote:Originally posted by Martin Honnen
 An XSLT stylesheet is XML so you can use the normal XML mechanisms like
Code:
<!DOCTYPE xsl:stylesheet SYSTEM "stylesheet.dtd">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
...
</xsl:stylesheet>

--
Martin Honnen
Microsoft MVP - XML
 
Old August 11th, 2008, 10:22 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

The path "../../stylesheet.dtd" seems fine for the folder structure you describe. What does "it did not work" mean exactly? Which parser/XSLT processor exactly do you use in which way, which error message exactlyy do you get?

--
  Martin Honnen
  Microsoft MVP - XML
 
Old August 11th, 2008, 10:51 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Am using xalan 2.0. When i run the part of code i mentioed you earlier, the xsl searches only for one director behind ... that is up to folder2. It does not search the dtd file in folder1. Am i explaining better?

Quote:
quote:Originally posted by Martin Honnen
 The path "../../stylesheet.dtd" seems fine for the folder structure you describe. What does "it did not work" mean exactly? Which parser/XSLT processor exactly do you use in which way, which error message exactlyy do you get?

--
Martin Honnen
Microsoft MVP - XML
 
Old August 11th, 2008, 10:58 AM
Friend of Wrox
 
Join Date: Nov 2007
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 Posts
Default

I am not sure how to help further. Test whether the issue is specific to Xalan (by trying a different prococessor like Saxon), if so ask on a Xalan user list.

--
  Martin Honnen
  Microsoft MVP - XML
 
Old August 11th, 2008, 11:02 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, i will check with them

Quote:
quote:Originally posted by Martin Honnen
 I am not sure how to help further. Test whether the issue is specific to Xalan (by trying a different prococessor like Saxon), if so ask on a Xalan user list.

--
Martin Honnen
Microsoft MVP - XML
 
Old August 12th, 2008, 02:35 AM
Authorized User
 
Join Date: Jul 2008
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is it possible to include a dtd file that is not in my Application package. That is ...

C:
  folder1
     splChar.dtd
  .
  .
  .
  MyAppfolder
    ..
     ..
      myXslFolder
         myXsl.xsl

Is it possible to include splChar.dtd (from outside the package) in to myXsl.xsl?

Quote:
quote:Originally posted by Martin Honnen
 I am not sure how to help further. Test whether the issue is specific to Xalan (by trying a different prococessor like Saxon), if so ask on a Xalan user list.

--
Martin Honnen
Microsoft MVP - XML





Similar Threads
Thread Thread Starter Forum Replies Last Post
Automated tool to convert XML from DTD to DTD lsantos2000 XSLT 2 October 17th, 2007 08:21 AM
how to parse the XML file and DTD through Xerces tufailfifa C++ Programming 0 June 25th, 2007 07:03 AM
how to parse the XML file and DTD tufailfifa XML 0 June 25th, 2007 07:02 AM
How to use DTD file for a XML file cJeffreywang XML 0 November 9th, 2005 04:20 PM
help with dtd file format jsbxml XML 0 January 17th, 2005 04:31 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.