From: Arek S. <dev...@kr...> - 2004-02-18 13:48:07
|
Hi, Is it possible to send XML Fragments or XUpdate documents with SAX to eXi= st? I=20 found in XUpdateQueryService only method which take String. All XML documents in my program are loaded to Java as beans with XMLBeans= =20 (http://dev2dev.bea.com/technologies/xmlbeans/index.jsp) binding framewor= k.=20 Then they are changed by user, I save them with code similar to this: XMLResource r =3D (XMLResource) col.getResource(xmlName); ContentHandler contentHandler =3D r.setContentAsSAX(); =20 document.save(contentHandler, (LexicalHandler) contentHandler); col.storeResource(r); The documents are not very big (currently with test data 5-20 KB), but I = can=20 image they could grow then program start to be used in real (max to 100 K= B).=20 Then any change happen I know exactly the XPath to element or attribute, = so I=20 was thinking of using XUpdate to change only this single place in documen= t. If I understand how this works, I will need to build XUpdate document as=20 String (or convert some Object representing it to String) and send it wit= h=20 XUpdateQueryService. Then eXist need to parse this String, and do the job= . As I run eXist in embedded version in same JVM, I don't see it as good=20 solution for me. Probably I will not get it quicker comparing to current=20 solution, as documents are not very big. It will be great if in XUpdateQueryService I could specify document, and = XPath=20 to element, and send XML Fragment with SAX in similar way I do it now wit= h=20 XMLResource. Is anything like this possible or you plan something similar in the futur= e? Maybe there is some other technique to updated documents I could use? Best regards Arek |