This is a bit tricky as ContentHandler is a callback (push) API while
InputStream is a pull API.

Marrying the 2 is quite difficult.

 

I suggest serializing the data to a temporary file then using the File
as the input to newContent()

This has the additional advantage of allowing XCC to intelligently retry
as needed.

 

 

 

----------------------------------------

David A. Lee

Senior Principal Software Engineer

Epocrates, Inc.

[email protected]

812-482-5224

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Gary
Larsen
Sent: Wednesday, June 01, 2011 2:41 PM
To: 'General MarkLogic Developer Discussion'
Subject: [MarkLogic Dev General] Storing with a ContenHandler

 

Sorry if this is a bit off topic.  

 

The XML data I'm storing to MarkLogic (Java XCC) is being processed
through one or more ContentHandlers.  With eXist I would create a
resource that would accept the ContentHandler stream.

 

I'm trying to figure out how to convert the ContentHandler stream to in
InputStream for use with one of the ContentFactory.newContent() methods.

 

>From looking at the samples it appears that eventually I should use the
DynamicContentStream class but I need to figure out the conversion
problem first. 

 

I'd really appreciate any pointers in this area.

 

Thanks,

gary

 

 

_______________________________________________
General mailing list
[email protected]
http://developer.marklogic.com/mailman/listinfo/general

Reply via email to