Hi to everybody, i’m new and this is my first topic! I’m just learning the tamino API for java and i’ve some problem[…of course! :)] Before to begin i’m sorry for my english! be patient! Well…let’s start! i’d like to understand how to pass a dom object to tamino!
i use this:
import com.docuverse.dom.*;
</pre><BR><BR>i create my dom document:<pre class="ip-ubbcode-code-pre"> //DOM:
BasicDocument doc = new BasicDocument();
//<TAG>
BasicElement TAuthor =new BasicElement(doc,"Author");
BasicElement TAuthorName=new BasicElement(doc,"AuthorName");
BasicElement TLivingPeriod=new BasicElement(doc,"LivingPeriod");
BasicElement TTitles =new BasicElement(doc,"Titles");
TAuthorName.appendChild(new BasicText(doc,aut.getAuthorName()));
TLivingPeriod.appendChild(new BasicText(doc,aut.getLivingPeriod()));
TAuthor.appendChild(TAuthorName);
TAuthor.appendChild(TLivingPeriod);
TAuthor.appendChild(TTitles);
</pre><BR><BR>and then:<pre class="ip-ubbcode-code-pre">
StringReader stringReader = new StringReader(TAuthor.toString());
TXMLObject xmlObject = TXMLObject.newInstance(TDOMObjectModel.getInstance());
xmlObject.readFrom(stringReader);
TXMLObjectAccessor xmlObjectAccessor = tamino.newXMLObjectAccessor( TAccessLocation.newInstance( "Annales" ),TDOMObjectModel.getInstance());
xmlObjectAccessor.insert(xmlObject);
</pre><BR>my problem is:<BR>I don't want use the String reader! <BR><BR>In other topic i've read:<BR><pre class="ip-ubbcode-code-pre">TXMLObject xmlObject = TXMLObject.newInstance(myDomObject);
but it doesn’t work!or better…i don’tknow how to transform “myDOMDocument” into TDOMObjectModel!
//Insert elements in the document Element TAuthor = document.createElement(“Author”); Element TAuthorName = document.createElement(“AuthorName”); Element TLivingPeriod = document.createElement(“LivingPeriod”); Element TTitles = document.createElement(“Titles”);
tnx a lot Vicky! but maybe i’ve made a wrong question!
in your program you did:
TXMLObject xmlObject = TXMLObject.newInstance(TAuthor.toString());
</pre><BR><BR>you don't use StringReader but the method toString().<BR>What i wanted to know it's if is possibile to do:<BR><pre class="ip-ubbcode-code-pre"> TXMLObject xmlObject = TXMLObject.newInstance(DOMDOCUMENT);