// File: XmlMDocStd_XLinkDriver.cxx // Created: 04.09.01 14:47:31 // Author: Julia DOROVSKIKH // Copyright: Open Cascade 2001 // History: #include #include #include #include #include IMPLEMENT_DOMSTRING (DocEntryString, "documentEntry") //======================================================================= //function : XmlMDocStd_XLinkDriver //purpose : Constructor //======================================================================= XmlMDocStd_XLinkDriver::XmlMDocStd_XLinkDriver (const Handle(CDM_MessageDriver)& theMsgDriver) : XmlMDF_ADriver (theMsgDriver, NULL) {} //======================================================================= //function : NewEmpty //purpose : //======================================================================= Handle(TDF_Attribute) XmlMDocStd_XLinkDriver::NewEmpty() const { return (new TDocStd_XLink()); } //======================================================================= //function : Paste //purpose : persistent -> transient (retrieve) //======================================================================= Standard_Boolean XmlMDocStd_XLinkDriver::Paste (const XmlObjMgt_Persistent& theSource, const Handle(TDF_Attribute)& theTarget, XmlObjMgt_RRelocationTable& ) const { XmlObjMgt_DOMString anXPath = XmlObjMgt::GetStringValue (theSource); if (anXPath == NULL) { WriteMessage ("XLink: Cannot retrieve reference string from element"); return Standard_False; } TCollection_AsciiString anEntry; if (XmlObjMgt::GetTagEntryString (anXPath, anEntry) == Standard_False) { TCollection_ExtendedString aMessage = TCollection_ExtendedString ("Cannot retrieve XLink reference from \"") + anXPath + '\"'; WriteMessage (aMessage); return Standard_False; } Handle(TDocStd_XLink) aRef = Handle(TDocStd_XLink)::DownCast(theTarget); // set referenced label aRef->LabelEntry(anEntry); // document entry aRef->DocumentEntry(theSource.Element().getAttribute(::DocEntryString())); return Standard_True; } //======================================================================= //function : Paste //purpose : transient -> persistent (store) //