🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.xml
1 messages
1 total messages Started by J. User Thu, 07 Oct 2004 18:52
possible to read/write only part of an xml doc?
#22
Author: J. User
Date: Thu, 07 Oct 2004 18:52
22 lines
2192 bytes
Hi,

To elaborate a bit I have used Borland xml databinding with a dtd to create classes that read/write an xml doc 
conforming to a dtd. So far so good... if I want to read a whole document or write a whole document then I just 
call the marshal/unmarshal methods of the object representing the document root. 

My question is whether or not I can write/read only part of a document. For example consider a book with 
elements for title, contents, chapters and index. If I have an xml fragment that represents one chapter can I 
use the generated classes to read just that fragment and return a class instance representing that chapter? 
Going the other direction if I have the complete book represented by instantiated classes could I call a method 
(is there such a method) in the class representing a chapter element and have it write out the xml for just that 
chapter? 

Or are things set up when the marshal/unmarshal method for the root is called that are necessary for the proper 
fuctioning of the methods lower in the tree?

An example of why I might want to do this: a user has another app that would generate the xml for a chapter and 
paste it to the clipboard and I would like my app to generate the proper subtree by reading the clipboard 
contents, so that I can just add that child to the existing tree. The real app is more complex but the principle 
is the same.

Thanks in advance!
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads