Click here to Skip to main content
15,885,537 members
Home / Discussions / XML / XSL
   

XML / XSL

 
AnswerRe: Generating a new XML file starting with a XML file and applyng XSLT Pin
FJJCENTU5-Apr-10 8:56
FJJCENTU5-Apr-10 8:56 
QuestionCompiling an XML database with an application Pin
brdavid24-Mar-10 21:19
brdavid24-Mar-10 21:19 
AnswerRe: Compiling an XML database with an application Pin
Stuart Dootson28-Mar-10 21:46
professionalStuart Dootson28-Mar-10 21:46 
QuestionHow can i read or get an XML from another host? Pin
spawneditions24-Mar-10 8:58
spawneditions24-Mar-10 8:58 
AnswerRe: How can i read or get an XML from another host? Pin
daveyerwin25-Mar-10 6:33
daveyerwin25-Mar-10 6:33 
QuestionXSLT help Pin
Aljaz11124-Mar-10 4:39
Aljaz11124-Mar-10 4:39 
AnswerRe: XSLT help Pin
PIEBALDconsult24-Mar-10 5:04
mvePIEBALDconsult24-Mar-10 5:04 
GeneralRe: XSLT help Pin
Aljaz11124-Mar-10 5:13
Aljaz11124-Mar-10 5:13 
QuestionSerializing a complex object to XML [modified] Pin
CDP180222-Mar-10 22:39
CDP180222-Mar-10 22:39 
Hello,

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

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.