Click here to Skip to main content
14,775,008 members
Home » Discussions » XML / XSL


QuestionCompiling an XML database with an application Pin
brdavid24-Mar-10 22:19
Memberbrdavid24-Mar-10 22:19 
AnswerRe: Compiling an XML database with an application Pin
Stuart Dootson28-Mar-10 22:46
professionalStuart Dootson28-Mar-10 22:46 
QuestionHow can i read or get an XML from another host? Pin
spawneditions24-Mar-10 9:58
Memberspawneditions24-Mar-10 9:58 
AnswerRe: How can i read or get an XML from another host? Pin
daveyerwin25-Mar-10 7:33
Memberdaveyerwin25-Mar-10 7:33 
QuestionXSLT help Pin
Aljaz11124-Mar-10 5:39
MemberAljaz11124-Mar-10 5:39 
AnswerRe: XSLT help Pin
PIEBALDconsult24-Mar-10 6:04
professionalPIEBALDconsult24-Mar-10 6:04 
GeneralRe: XSLT help Pin
Aljaz11124-Mar-10 6:13
MemberAljaz11124-Mar-10 6:13 
QuestionSerializing a complex object to XML [modified] Pin
CDP180222-Mar-10 23:39
MemberCDP180222-Mar-10 23:39 

for a business application in C# I have a more complex object representing an article. Attached to this object there are numerous further objects representing the suppliers, prices, storage locations and quite a few things more. These objects in turn may have further objects or collections with further information. In the end the whole structure represents everything we have in the database concerning this article. Please note, this is not a DataSet. It's a complex data object loaded from the database with NHibernate.

Now we would like to serialize selected articles to XML. We have prepared a XML schema, but now it's the question how we proceed with serializing. I could simply use a XmlWriter class and provide each data object with a method to serialize itself and recursively all attached objects and collections, but I hope there is a better way.

Is there a way to associate the schema with the data objects and their properties and then serialize the data objects with the bonus of not having to write serialization methods for each and every data object and also validation against the schema?

Edit: I took a closer look at the System.Xml.Serialisation namespace, but unfortunately this will not help in this case. The problem is that I would have to decorate a collection of articles with the XmlRoot attribute. Due to the number of articles to be serialized I cannot simply fill some kind of collection and then serialize everything. It must be done one article at a time.
A while ago he asked me what he should have printed on my business cards. I said 'Wizard'.

I read books which nobody else understand. Then I do something which nobody understands. After that the computer does something which nobody understands. When asked, I say things about the results which nobody understand. But everybody expects miracles from me on a regular basis. Looks to me like the classical definition of a wizard.

modified on Tuesday, March 23, 2010 5:58 AM

Questionbuild one xml element with few childs Pin
Aljaz11122-Mar-10 17:04
MemberAljaz11122-Mar-10 17:04 
QuestionXQUERY fn:replace() inserting spaces? Pin
tom_masciovecchio12-Mar-10 11:17
Membertom_masciovecchio12-Mar-10 11:17 
Questionnew to xml..please help.. Pin
A-MEN12-Mar-10 10:11
MemberA-MEN12-Mar-10 10:11 
AnswerRe: new to xml..please help.. Pin
SeMartens18-Mar-10 22:36
MemberSeMartens18-Mar-10 22:36 
AnswerRe: How to convert portlet into gadget Pin
Not Active12-Mar-10 5:32
mentorNot Active12-Mar-10 5:32 
QuestionHelp Finding Content Pin
jammmie9996-Mar-10 5:16
professionaljammmie9996-Mar-10 5:16 
AnswerRe: Help Finding Content Pin
Stuart Dootson6-Mar-10 6:06
professionalStuart Dootson6-Mar-10 6:06 
GeneralRe: Help Finding Content Pin
jammmie9996-Mar-10 7:17
professionaljammmie9996-Mar-10 7:17 
NewsBuilding Web 2.0 UIs with JSF, Realtime Updates with JSF and Ajax Push Taught at GIDS 2010 Pin
Shaguf Mohtisham3-Mar-10 21:31
MemberShaguf Mohtisham3-Mar-10 21:31 
QuestionVS2005 doesn't like my XML Schema Pin
gritter3-Mar-10 6:10
Membergritter3-Mar-10 6:10 
AnswerRe: VS2005 doesn't like my XML Schema Pin
gritter3-Mar-10 7:41
Membergritter3-Mar-10 7:41 
AnswerRe: VS2005 doesn't like my XML Schema Pin
Stuart Dootson6-Mar-10 5:58
professionalStuart Dootson6-Mar-10 5:58 
GeneralRe: xml code editor Pin
Covean2-Mar-10 23:21
MemberCovean2-Mar-10 23:21 
QuestionMultiple children in Node question Pin
RCoate1-Mar-10 21:04
MemberRCoate1-Mar-10 21:04 
AnswerRe: Multiple children in Node question Pin
Stuart Dootson1-Mar-10 22:02
professionalStuart Dootson1-Mar-10 22:02 
GeneralRe: Multiple children in Node question Pin
RCoate1-Mar-10 22:56
MemberRCoate1-Mar-10 22:56 
GeneralRe: Multiple children in Node question Pin
Stuart Dootson1-Mar-10 23:04
professionalStuart Dootson1-Mar-10 23:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.