471,319 Members | 3,253 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

designing a class library that uses .xsd files

I need to move some code which at present is residing in some .aspx
codebehind files into a separate class library.

One of the functions makes use of an xml schema to create the structure
for a DataSet object which is returned to the caller. Currently the
schema is stored in an .xsd file which exists in the /schemas folder
underneath the root of the website.

If I were to move this function into a class, I'm unsure of the correct
way I should be accessing the .xsd file. The class needs to be portable
and so mustn't assume that it's running as part of a web app and thus
shouldn't look in the /schemas folder.

Am I right in thinking that the only way is to distribute the .xsd file
with the .dll used for the new class library I intend to create.

Wayne.

Jul 21 '05 #1
2 2036
sounds like a simple design problem.

When extracting the code into your dll from the code-behind, change is
slightly to take either the XSD file's filename, or a stream containing the
XSD file. The calling code will get that responsibility, while the called
code will simply use the passed information to perform the necessary
activities.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
--
"wh1974" <wa***@pyesmeadow.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
I need to move some code which at present is residing in some .aspx
codebehind files into a separate class library.

One of the functions makes use of an xml schema to create the structure
for a DataSet object which is returned to the caller. Currently the
schema is stored in an .xsd file which exists in the /schemas folder
underneath the root of the website.

If I were to move this function into a class, I'm unsure of the correct
way I should be accessing the .xsd file. The class needs to be portable
and so mustn't assume that it's running as part of a web app and thus
shouldn't look in the /schemas folder.

Am I right in thinking that the only way is to distribute the .xsd file
with the .dll used for the new class library I intend to create.

Wayne.

Jul 21 '05 #2
Thank you for your suggestion.

Before I implement this change in the design, what are your thoughts of
including the .xsd file as a resource embedded in the assembly?

Thanks once again,
Wayne.

Jul 21 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by E G | last post: by
12 posts views Thread by James Brown | last post: by
7 posts views Thread by Peter Bradley | last post: by

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.