473,659 Members | 2,980 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DOCTYPE Declaration using XmlSerializer

raj
Can any one let me know how I can DOCTYPE (DTD declaration) to the XML
generated by XmlSerializer
Nov 12 '05 #1
3 4882


raj wrote:
Can any one let me know how I can DOCTYPE (DTD declaration) to the XML
generated by XmlSerializer


Why do you need a DTD, with XML serialization there is a mapping between
..NET types and W3C XML schema types so there is no need for a DTD as the
schema describes the structure and types of the serialized XML.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Nov 12 '05 #2
raj
I need to send this XML to a website, which is expecting the DOCTYPE
declaration in the xml.

"Martin Honnen" wrote:


raj wrote:
Can any one let me know how I can DOCTYPE (DTD declaration) to the XML
generated by XmlSerializer


Why do you need a DTD, with XML serialization there is a mapping between
..NET types and W3C XML schema types so there is no need for a DTD as the
schema describes the structure and types of the serialized XML.

--

Martin Honnen
http://JavaScript.FAQTs.com/

Nov 12 '05 #3
raj wrote:
I need to send this XML to a website, which is expecting the DOCTYPE
declaration in the xml.


You can easily write simple custom XmlWriter, which emits DOCTYPE when
the document being written - inherit XmltextWriter, override
WriteStartDocum ent(), call base.WriteStart Document() and then add call
to WriteDocType().
Then serialize via instance of this XmlWriter.
Tell me if you have any troubles implementing it.

--
Oleg Tkachenko [XML MVP]
http://blog.tkachenko.com
Nov 12 '05 #4

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

Similar topics

1
2694
by: Ken Larson | last post by:
I have a question about using XSL to extract information from an SVG (XML) file that has a DOCTYPE/DTD declaration. I am able to do this successfully if I write my own SVG files without such a declaration. However, I would like to extract some parts of an SVG file exported by illustrator. When I try this, my XSL file is no longer able to access the nodes in the SVG document properly - somehow related to the DOCTYPE/DTD declaration. ...
2
2017
by: Tony T | last post by:
I'm not a regular here - strictly an amateur web developer - but I've got so frustrated I'd really appreciate any help anyone can give. I'm working on a PC platform with Win ME. I'm developing a new set of web pages, using html4.01 strict with css2 stylesheets. As part of the design, I need to be able to monitor and measure the vertical scrolling of my document in the viewport. I have got this to work with up-to-date Netscape and Opera...
7
2800
by: David Ross | last post by:
I manually code my HTML without using any page generating software. I need to know how to specify the DOCTYPE at the beginning of my HTML files. No, I don't want a "canned" DOCTYPE statement. I want to understand what the different fields mean so that I can tailor them to what I am really doing. --
2
13537
by: Mullin Yu | last post by:
I am using XmlSerializer to serialize an object to xml string like the following at C#. Now, I want to know how can I 1. change the default encoding to utf-8 or others, instead of utf-16 2. remove the XML declaration => <?xml version ....> 3. remove the white space / tab of the xml structure XmlSerializer( typeof( PrinterSetting ) ) But, I got the something like the following:
6
8338
by: David B. Bitton | last post by:
I am having a problem deserializing XML when the root node is missing a namespace declaration. My Type has an XmlTypeAttribute with a namespace defined. If I attempt to deserialize the XML, I get the dreaded <elementname xmlns=''> was not expected exception. If I comment out the XmlTypeAttribute, it works just fine. Just so you know, when I instantiate an instance of an XmlSerializer, I pass a default namespace to the ctor. ...
3
14763
by: Vlad | last post by:
I have a class that serialize using the XmlSerializer. I am using several attributes for class members to control serialization process. One thing I cannot figure out how to do is how to add DOCTYPE attribute to the file. This XML file must use the doctype that refers to the DTD rather than an XSD. Could someone point out how to accomplish that using the attributes or by some other means?
29
2938
by: AndyZa | last post by:
According to the w3c specs a web page is not valid if the DOCTYPE declaration is missing. So, if I add the following doctype to my pages they will be "compliant": <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> But is this relevant to INTRANET sites where users might not have INTERNET access? How does the page get validated against the http://www.w3.org/TR/html4/strict.dtd DTD if the users...
6
7842
by: Rolf Welskes | last post by:
Hello, if I have for example: <table style="width: 100%; height: 100%;" border="1"> <tr> <td style="width: 100px">k </td> <td style="width: 100px">k </td> </tr>
0
8541
drhowarddrfine
by: drhowarddrfine | last post by:
The Doctype or DTD Many coders get confused by all the talk of doctypes and how they affect browsers and the display of their web pages. This article will get right to the point about doctypes and their use. Doctype is short for its full name "Document Type Definition", or DTD. If you pay attention to what those words mean, you will notice that it is used in your web page, the document, to define the data types, that is, the elements...
0
8428
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
8851
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
8747
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...
1
8528
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8627
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
6179
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
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
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...
2
1737
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.