Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML 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 January 5th, 2004, 08:02 AM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Serializing headers in VB.NET

All,
I am trying to generate the following header when serializing a class to XML

<FpML
 version="4-0"
 xsi:type="TradeAffirmation"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.fpml.org/2003/FpML-4-0 fpml-main-4-0.xsd"
 xmlns="http://www.fpml.org/2003/FpML-4-0">
</FpML>

The class is currently declared as:
<System.Xml.Serialization.XmlTypeAttribute([Namespace]:="http://www.fpml.org/2003/FpML-4-0"), _
 System.Xml.Serialization.
 System.Xml.Serialization.XmlRootAttribute([Version]:="4-0"), _
 System.Xml.Serialization.XmlRootAttribute([Namespace]:="http://www.fpml.org/2003/FpML-4-0", IsNullable:=false)> _
Public Class FpML
End Class


This generates the following:
<FpML xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.fpml.org/2003/FpML-4-0">
</FpML>

I am unsure how to get my code to generate the header correctly. Any ideas?

Many thanks
Paul






Similar Threads
Thread Thread Starter Forum Replies Last Post
why serializing class? hertendreef ASP.NET 1.0 and 1.1 Basics 5 March 25th, 2007 11:47 AM
Article posted: Using SOAP Headers with ASP.NET jminatel XML 0 May 5th, 2006 04:30 PM
New article posted:Using SOAP Headers with ASP.NET jminatel ASP.NET 2.0 Professional 0 May 5th, 2006 04:28 PM
.NET DataGrid Column Headers ashley_y General .NET 1 October 25th, 2004 03:00 PM





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