XMLSerializer for javascript

Hello,
Can XMLSerializer be called from javascript ?
How can I use XMLSerializer on the client side, and on the server side ?

I need an example, please.

Thanks :)


0
Mr
9/21/2003 7:03:30 AM
dotnet.xml 7266 articles. 0 followers. Follow

3 Replies
1034 Views

Similar Articles

[PageSpeed] 35

Mr. x wrote:

> Can XMLSerializer be called from javascript ?
Not in javascript, but in JScript.NET.

> How can I use XMLSerializer on the client side, and on the server side ?
XmlSerializer (if you're talking about System.Xml.Serialization.XmlSerializer 
class of .NET) requires .NET environment. On server side it's usually ASP.NET, 
on client side - Windows forms or Web Forms.
-- 
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

0
oleg7603 (294)
9/21/2003 9:52:00 AM
Thanks ....

Well, on JScript.NET.
I need an example, please.

Thanks :)

"Oleg Tkachenko" <oleg@NO_SPAM_PLEASEtkachenko.com> wrote in message
news:ONskzzBgDHA.2072@TK2MSFTNGP10.phx.gbl...
> Mr. x wrote:
>
> > Can XMLSerializer be called from javascript ?
> Not in javascript, but in JScript.NET.
>
> > How can I use XMLSerializer on the client side, and on the server side ?
> XmlSerializer (if you're talking about
System.Xml.Serialization.XmlSerializer
> class of .NET) requires .NET environment. On server side it's usually
ASP.NET,
> on client side - Windows forms or Web Forms.
> -- 
> Oleg Tkachenko
> http://www.tkachenko.com/blog
> Multiconn Technologies, Israel
>


0
Mr
9/21/2003 4:51:56 PM
Mr. x wrote:

> Well, on JScript.NET.
> I need an example, please.

Sorry, I'm not JScript.NET expert, see 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlserializationxmlserializerclassserializetopic2.asp
it provides JScript.NET syntax too.
-- 
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

0
oleg7603 (294)
9/22/2003 11:04:59 AM
Reply:

Similar Artilces:

XmlSerializer Collection with Collections
Hello I got this working but it is not how I really want it, basically I have an xml file which has a root of <test> and can be filled with 3 different types of <question> elements with different attributes, all share a base set of 4, one of the question types can have children with <option> elements, this is how the xml looks after serialization.... If you notice there is an extra <SelectionList> around the <option>'s in the final <question>, how can I write my class so I don't have this extra <SelectionList> element....my class follows, you ...

XmlSerializer
I'm having a basic problem with the XmlSerializer & i'm at my wits end trying to sort it out i have a basic clas <Serializable()> Class Tes Public Name as Strin End Clas when this serializes i wan <Test><Name>Value</Name></Test the problem is if i use the XmlSerializer clas Dim t as Tes t.Name="Value Dim sb As New StringBuilde Dim sw As New StringWriter(sb Dim Serializer As New XmlSerializer(Message.GetType Serializer.Serialize(sw, t Serializer = Nothin Console.Write(sb.ToStr...

XmlSerializer and shared objects (or How to generate IDREFs using XmlSerializer)
This is a multi-part message in MIME format. ------=_NextPart_000_007F_01C34AC1.11D4FB20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I am trying to find a solution that will allow me to use XmlSerializer = to serialize/deserialize a collection of objects where a given object is = shared between two or more other objects, and not create duplicate XML = representations of the shared object, but instead use IDREFs to refer to = the shared object. The XML I'm trying to produce is as follows (where "href" is an IDREF): <...

XmlSerializer and inherited objects
Hi I have a hirachy of classes which are Message(base), then FileMessage and ChatMessage (extended) I want to serialize the objects and when i am deserizaling i dont know if i am getting FileMessage or ChatMessage. So how to get that object and use it I have written following code for serialization public void Send(Message message) { NetworkStream netWorkStream=null; try { XmlSerializer serializer=new XmlSerializer(message.GetType()); netWorkStream=new NetworkStream(_clientSocket); Stream stream=(Stream)netWorkStream; serializer.Serialize(stream,message); } finally { netWorkStrea...

XMLSerializer Serialize
Iam trying to create a xml file by serializing a custom business object. Iam using a xmltextwriter, but the problem there are invalid characters at the end of the generated file anyone knows a way around it ? tia Dim myStream As New IO.MemoryStream Dim myXMLWriter As New System.Xml.XmlTextWriter(myStream, System.Text.Encoding.UTF8) myXMLWriter.Formatting = System.Xml.Formatting.Indented Dim myShipments As OrderShipments myShipments = CType(myOrder.OrderAddresses(0), COrderAddress).Shipments myShipments.ToXML(myXMLWriter) ...

writing more than one javascript functions for OnSave of an entity
Hi, I want to check whether value of an attribute (field) for an entity is null or not. I want to 'trim' the value before checking. As there is no built in trim function with javascript, I have a seperate function. I want this function to be available to whole javascript code so that I can check the values for all the required attributes. Where should I put this seperate trim function? regards... Hi, My favourite way is to dynamically define function in onLoad event and than use it in the Form, may be in onChange event. But this function will only be available in that partic...

XmlSerializer help
Hi, I have a class: public class Note { public string name; public string information; } And i Serialize this class, but want to Serialize it to an XmlDocument which will contain many of these elements. How do i do this? Thank you, Tim. Timothy, take a look at Chris Lovett's XmlNodeWriter on www.gotdotnet.com [0]. Simply pass the node where you want to insert the serialized XML into the XmlDocument to an XmlNodeWriter and pass the XmlNodeWriter to the Serialize method. -- HTH Christoph Schittko [MVP] Software Architect, .NET Mentor [0] http://gotdotnet.com/Communit...

VB6 : WebBrowser Control : Disablign JavaScript support
Hi, Is it possible to programatically tell the WebBrowser control that JavaScript is not available? Is that some sort of option that I would set prior to calling the .Navigate method? Thanks. Sarah. The WB properties and methods are nearly identical to IE, so I don't think there's anything you can do directly. You could get the page first and remove the script, but that would be messy. You could also temporarily change the settings in the Registry, but that would also affect IE instances. And depending on where the page loads from you have up to 40 possible ...

Problems with XmlSerializer and namespaces
I have an object, Teacher, that has a namespace. Let's call it http://foo. Teacher has a child object called Name, composed of String first, middle, last, etc. Problem I have is when I try to deserialize it. When I deserialize a single Teacher, it works when I put the namespace on the Teacher element. However, if I have just the namespace on Teacher, it will deserialize fine as Teacher. *However*, if I try to deserialize an ArrayOfTeacher, Teacher.Name doesn't deserialize (it's null); without the array, it's OK. What I wound up doing was serializing both a Teacher ...

Write javascript
Hi, How can I dynamically embed the content of a filename.js into a .aspx page before rendering it to the client? Thanks, ~yamazed Hello! > How can I dynamically embed the content of a filename.js into a .aspx page > before rendering it to the client? This has nothing to do with XML... Try Response.WriteFile, I don't know a WebForms-Way, but it should be easy to create a custom control for it. -- Pascal Schmitt I figured it out!!! This is awesome! Check out: http://www.codeproject.com/csharp/EmbeddedResourceStrings.asp http://weblogs.asp.net/asmith/articles/25465....

XmlSerializer and ICollection
Hello all, I have two simple classes: Item and ItemCollection. Item stores a label for the item and an instance of ItemCollection for all child items. ItemCollection just stores a collection of Items. ItemCollection implements System.Collections.ICollection. When I use XmlSerializer to serialize an instance of ItemCollection, I am unable to control the element names used to contain the item collection and the items therein. Applying XmlRootAttribute to the ItemCollection class causes an exception because it implements ICollection. I have also tried implementing IXmlSerializer in my ItemColl...

Expected ';'
Hi all, in my ASP.NET 3.5 application I'm having this javascript error when I open some pages: User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E) Timestamp: Mon, 15 Mar 2010 11:12:39 UTC Message: Expected ';' Line: 206 Characted: 45 Code: 0 URI: mypath and if I click F12 in IE8 to view the source of the page, the line 206 begins with: var WebCustomControl11_ucRicostruzioneMisure.ascx_Data_dateRegularExpres...

XmlSerializer question
Hi, I use XmlSerializer to serialize xml string. It escapes xml special charaters, like < and > to < and >. How can I stop XmlSerializer to escape these charaters? Thanks in advance!!! Cindy Cindy wrote: > I use XmlSerializer to serialize xml string. It escapes xml special > charaters, like < and > to < and >. How can I stop XmlSerializer to escape > these charaters? If the XmlSerializer didn't escape the characters < and & (and for compatibility >), then the result would not be well-formed XML. See section 2.4 of the XML specification [1]...

XmlSerializer and DefaultValue?
Hello, I'm currently playing around with the XmlSerializer to replace my old handmade Xml parsing code, but am having a few small issues with default values and derived classes. Say we have classes A, B and C: abstract class A { protected int a_value = 1; [XmlAttribute("value"), DefaultValue(1)] public int AValue { get { return a_value; } set { a_value = value; } } } class B : A { .... } class C : A { .... } Now, I want class B and C to have different default values, more precisely, I want B to have 1 as default value and C to have Int32.MaxValue. But I ...

XmlSerializer question...
Hi All, When using XmlSerializer is there anyway of keeping "xsi", "xsd" namespaces and PI appearing in the xml file ? <?xml version="1.0"?> <myClass xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="Test" Visible="false" /> Just want a simple clean one like the following... <ColumnInfo Name="Test" Visible="false" /> Thanks, Maersa wrote: > When using XmlSerializer is there anyway of keeping "xsi", "xsd"...

cant find examples for adding javascript to fields
Hi, i cant find any examples on the net regarding adding javascript to a field. Cos I have added a new field to a form and wanted to use this new field to calculated another field's data Any one knows how to go abt doing it? Kindly assist. Thanks In a supported manner, javascript can only be added to Picklists. This can be added via the form editor by going into the properties for the picklist. There will be a tab for events that will allow you to enter the code. The function header is taken care of for you, so you just add the actual code to run. Matt Parks MVP - Microsoft CRM...

How to XMLSerialize Collection Class
Hi, I have a collection class where I've implemeneted the ICollection Interface. Here is a small code segment. public class PageList : ICollection, IComparer, IEnumerable, IList { protected ArrayList _pages; public PageList() { _pages = new ArrayList(); } #region IList Members public object this[int index] { get { if (index > _pages.Count) { return (Page)null; } else { return (Page)_pages [index]; } } set { } } public int Add(object objPage) { int arrayIndexAdded = -1; arrayIndexAdded = _pages.A...

opening outlook with mailto from javascript (in html mode)
I like the abilith to use href=mailto:xxx@xxx.com?body=This is in the body The problem is that I can not get the default e-mail tool (Outlook) to open up in html format. It seems to only support plain text. If I do not add the body part of the href, then it opens in the default format which for me is html. Any ideas? Thanks in advance. Jim As I understand it, this is a limitation of the way Windows passes the mailto: command to the default email program. -- Sue Mosher, Outlook MVP Author of Microsoft Outlook Programming - Jumpstart for Administrators, Power Users, and Dev...

XMLSerializer for javascript
Hello, Can XMLSerializer be called from javascript ? How can I use XMLSerializer on the client side, and on the server side ? I need an example, please. Thanks :) Mr. x wrote: > Can XMLSerializer be called from javascript ? Not in javascript, but in JScript.NET. > How can I use XMLSerializer on the client side, and on the server side ? XmlSerializer (if you're talking about System.Xml.Serialization.XmlSerializer class of .NET) requires .NET environment. On server side it's usually ASP.NET, on client side - Windows forms or Web Forms. -- Oleg Tkachenko http://www.tkachen...

XmlSerializer Problem
Hi all, When I run this code: XmlSerializer theXS; try { theXS = new XmlSerializer(typeof(TableInfo)); } catch( System.Exception eAll ) { string junk = eAll.Message; return; } I get this exception: File or assembly name 5wpkczfu.dll, or one of its dependencies, was not found If I change the type of the object I'm trying to serialize I get references to other obscure missing dll files... none of which can be found on Google, oddly enough. Any thoughts or suggestions would be appreciated. - Nick Hi Nick, Is the TableInfo referencing any other classes that you wrote? If ...

XmlSerializer constructor
I'm having trouble constructing the XmlSerializer without getting a Configuration Exception(Only elements allowed: Line 3) in Dev Studio 2003. When I remove the <system.diagnostics> node from my app.config I don't have any issues but I wanted to keep the node. Please let me know if anyone has any ideas. app.config: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.diagnostics> <assert assertuienabled="true" logfilename="assert.txt"/> <switches> <add name="General"...

XmlSerializer is ambiguous in the namespace System.Xml.Serialization
error: 'XmlSerializer' is ambiguous in the namespace 'System.Xml.Serialization' In VS 2010 IDE at design time of an asp.net 4.0 site. Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols Imports System.Data Imports System.Data.SqlClient Imports System.Xml Imports System.Xml.Serialization Dim ser As New XmlSerializer(s.GetType) <- error reported here The bin file has system.xml.serialzation.xml and system.xml.serialzation.dll If I delete the dll the error goes away, but when I build then dll is put back into bin and...

XMLSerializer
The simple constructors of XMLSerializer class caches the typed serializer once it is generated. (Probably as you know, other XMLSerializer constructors will result in a memory leak because they will generate the assembly each time instead of using the cached one) a) When an XMLSerializer is used from ASP.NET, where exactly the generated typed serializer is getting cached? What is the probability/crieteria for the object in the cache may get distroyed/invalidated? b) Can we assume that once the XMLSerializer is initialized with the constructor XMLSerializer (sometype), all further X...

XmlSerializer and XslTransform
I'm making a 6-tiered application that is using Xml to tie the various layers together in a very clean manner. I'm also trying to do this on the 1.1 Framework although I'm willing to switch to the 1.0 Framework if need be. One layer, which I call a Data Persistence Layer, uses the System.Xml.Serialization.XmlSerializer to transform our business/domain objects into the appropriate Xml format. The layer below that is what I call a Data Transformation/Translation Layer. This layer converts the Xml from the Persistence layer into the appropriate format for storage (Sql server, fi...

XmlSerializer and TypeLoadException
Hello, I'm trying to deserialize an XML document into a objects with the XmlSerializer which works fine in my NUnit test suit but fails with a TypeLoadException in the server. The difference between the server and the NUnit test suit is that the server will load the assembly (Flux.Grease.Services.dll) as a plugin in its own AppDomain whereas the NUnit test suit reference the assembly in the usual way. The code that performs the deserialization reside in the Flux.Grease.Services assembly and looks like this: XmlSerializer serializer = new XmlSerializer(typeof(CitectExport)); citectExport...