473,903 Members | 5,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DTDs and xsl transforming

Jon
I am getting the following message when I try to transform an xml file that
specifies a DTD. I know how to allow DTDs when using an xmlreader, but not
when using the xsl transform. Can someone enlighten me, please.

System.Xml.XmlE xception was unhandled
Message="For security reasons DTD is prohibited in this XML document. To
enable DTD processing set the ProhibitDtd property on XmlReaderSettin gs to
false and pass the settings into XmlReader.Creat e method."

'Now transform it with xsl
'Load the style sheet.
Dim xslt As New XslCompiledTran sform()
xslt.Load("vend or.xslt")

' Execute the transform and output the results to a file.
xslt.Transform( "vendor.xml ", "vendor.htm l")

Thanks
Jon
Feb 3 '06 #1
2 13669
Jon
Nevermind, I see it now. Temporary brain meltdown.
"Jon" <ru******@msn.c om> wrote in message
news:ew******** ******@TK2MSFTN GP09.phx.gbl...
I am getting the following message when I try to transform an xml file that
specifies a DTD. I know how to allow DTDs when using an xmlreader, but not
when using the xsl transform. Can someone enlighten me, please.

System.Xml.XmlE xception was unhandled
Message="For security reasons DTD is prohibited in this XML document. To
enable DTD processing set the ProhibitDtd property on XmlReaderSettin gs to
false and pass the settings into XmlReader.Creat e method."

'Now transform it with xsl
'Load the style sheet.
Dim xslt As New XslCompiledTran sform()
xslt.Load("vend or.xslt")

' Execute the transform and output the results to a file.
xslt.Transform( "vendor.xml ", "vendor.htm l")

Thanks
Jon

Feb 3 '06 #2
Nic
1 New Member
Hi

I have a strange problem with the class XslCompiledTran sform.

I am getting an error when loading the XSLT file saying that DTD is prohibited. But there is no DTD in my XSLT file.

CODE:
string stylesheetUri = "http://server:port/URL/Transformation. xslt";
XslCompiledTran sform transform = new XslCompiledTran sform();
transform.Load( stylesheetUri);//EXCEPTION HERE

EXCEPTION:
System.Xml.XmlE xception: For security reasons DTD is prohibited in this XML document. To enable DTD processing set the ProhibitDtd property on XmlReaderSettin gs to false and pass the settings into XmlReader.Creat e method.

XSLT:
<?xml version="1.0" encoding="utf-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform">
<xsl:template match="RootNode ">
<html>
<head>
<title>Title</title>
</head>
<body>Body</body>
</html>
</xsl:template>
</xsl:stylesheet>

I have also tried this code, but I still get an error.

Now it tries to read the *non-existant* DTD.

CODE:
string stylesheetUri = "http://server:port/URL/Transformation. xslt";
XmlReaderSettin gs settings = new XmlReaderSettin gs();
settings.Prohib itDtd = false;
XmlReader reader = XmlReader.Creat e(stylesheetUri , settings);

EXCEPTION:
System.Xml.XmlE xception: Expected DTD markup was not found. Line 2, position 3.

Anyone have a solution?

Thanks a lot

Nic
Feb 14 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
1573
by: chris | last post by:
Hi, Does anyone know where you can get a copy of html and xhtml dtds? Saxon wants to grab them off the net each time, but by using a catalog and NWalshs' resolver you can get it to look for them on the harddrive. The problem is I can't get the all the dtd files, only xhtml1-strict.dtd and xhtml1-trans.dtd but they use other dtd files. I've tried w3.org and had a look on google but haven't found anything yet.
4
1551
by: nobody | last post by:
hello! do you know of any (free) preprocessor able to deal with DTDs? I'dlike to do things as #define with_b ... <!ELEMENT a (#PCDATA)> <!ELEMENT c (#PCDATA)>
4
4335
by: Clifford W. Racz | last post by:
I am an XML author and I am needing to do some SGML work as well. I am using James Clark's SP (SX) to transform my SGML source into an XML source for use with XSLTs. I am needing to write XSLTs for these SGML documents and it would be nice to have at tool that can do one of these things: 1. graphically view an SGML DTD 2. Transform an SGML DTD into an XML DTD (I would rather not implement it myself) for viewing with an XML DTD viewer...
1
1502
by: David Tucker | last post by:
i have an xml document that needs to use multiple dtds. each dtd may have the same element names in general but some will differe slightly. I want to use namspaces but every time I do so it complains about tags already defined. I do not want to use prefixes since that is almost like using new elements. is there a trick to using many dtds with the same element names ? thanks
81
4716
by: Michael Rozdoba | last post by:
I've been wandering around the results of numerous googles for several hours without reaching a conclusive solution, so I'm dipping a tentative toe back in ciwah... I've been persuaded here in the past that serving xhtml is a bad thing (tm). I want the extra constraints xhtml imposes. It has been suggested before to create a DTD which requires these & includes all the requirements of HTML 4.01 & validate against that.
5
1790
by: Daniel Crespo | last post by:
Is there a built-in method for transforming (1,None,"Hello!") to 1,None,"Hello!"? Thanks
4
1939
by: Showjumper | last post by:
I am using the NITF DTD for my xml files and i need to use 2 xsl files to do the transform: one for the <body.head> and the second for the <body.content>. I've got this so far for transforming using 1 xsl file: Dim doc As New XmlDocument doc.LoadXml(xmlText) Dim xslDoc As New XslTransform xslDoc.Load(xslpath) Dim sw As New StringWriter xslDoc.Transform(doc, Nothing, sw, Nothing)
9
3149
by: wardy1975 | last post by:
Hi All, Looking for a little expert advice on a few web standards issues. I am currently trying to understand the impact of web standards for a web application I work with. I have been doing a lot of research in the areas of XHTML and WAI compliance, and am attempting to come up with a recommendation for our product in terms of standards level compliance. Ideally, I would like to be at XHTML 1.0 Strict. However, in my reading I have...
2
3649
by: =?ISO-8859-1?Q?J=2E_Pablo_Fern=E1ndez?= | last post by:
Hello, Is ElementTree supposed to load DTDs? I have some xmls heavy on entities and it fails this way: Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) on linux2 Type "help", "copyright", "credits" or "license" for more information. Traceback (most recent call last): File "<stdin>", line 1, in <module>
0
10007
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9854
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
11297
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10882
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10504
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
8059
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5899
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6100
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3329
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.