HighTechTalks DotNet Forums  

Strongly Typing XML String/Document Argument

Dotnet XML microsoft.public.dotnet.xml


Discuss Strongly Typing XML String/Document Argument in the Dotnet XML forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Schemed
 
Posts: n/a

Default Strongly Typing XML String/Document Argument - 11-12-2007 , 09:18 PM






Hello All,

I have the following abstract function:

public abstract BookList LoadBooks(string ListBookXml);
public abstract BookList LoadBooks(XmlDocument ListBooks);

Is there any way to type the argument of each function so that it
corresponds to the required schema without resorting to an
XmlSerializable class as a parameter?

Thanx


Reply With Quote
  #2  
Old   
GlennAB
 
Posts: n/a

Default RE: Strongly Typing XML String/Document Argument - 11-13-2007 , 06:01 AM






XML is a pretty wide funnel, without resorting to a searialisable type you'd
have to consider XML validation and maybe throw up an exception.

Glenn

"Schemed" wrote:

Quote:
Hello All,

I have the following abstract function:

public abstract BookList LoadBooks(string ListBookXml);
public abstract BookList LoadBooks(XmlDocument ListBooks);

Is there any way to type the argument of each function so that it
corresponds to the required schema without resorting to an
XmlSerializable class as a parameter?

Thanx



Reply With Quote
  #3  
Old   
Schemed
 
Posts: n/a

Default Re: Strongly Typing XML String/Document Argument - 11-13-2007 , 11:51 AM



I figured as much.

I think it would be a nice feature to be able to enforce a contract
that could expose the xml type expected and accept it as an xml string
or document parameter. I guess behind the scenes all the validation
code would need to run anyways and any performance gains would be lost
anyways.

Thanx


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.