Did anyone have a script to export to XML with all the OLE Objects and Pictures and Imported back to DOORS having the same format and with the OLE Objects in-place. |
Re: XML Importer/Exporter |
Re: XML Importer/Exporter SystemAdmin - Fri Mar 06 07:41:21 EST 2009 |
Re: XML Importer/Exporter Tony_Goodman - Fri Mar 06 08:36:03 EST 2009 Types: DOM_Document_ DOM_Element_ Perms: DOM_Document_ parseXMLBuffer_ (Buffer) DOM_Element_ getDocumentElement_ (DOM_Document_) string getElementName_ (DOM_Element_) string getElementText_ (DOM_Element_) bool hasChildElements_ (DOM_Element_) bool hasAttribute_ (DOM_Element_, string) string getStringAttribute_ (DOM_Element_, string) Loops: for DOM_Element_ in _DOM_Element_ do Useage is: 1) Read an XML file into a buffer. 2) Parse the buffer into a DOM_Document_. 3) Get the document element into a DOM_Element_. 4) Loop recursively through the DOM_Element_s in each DOM_Element_, doing stuff with the Element Names and Element Texts you find there. I have no idea what perms to use to write to an XML file. Maybe someone can give the same hints here as I have for reading from an XML file... |
Re: XML Importer/Exporter Tony_Goodman - Fri Mar 06 08:36:03 EST 2009 |
Re: XML Importer/Exporter Tippers - Mon Mar 09 08:22:23 EDT 2009 |
Re: XML Importer/Exporter Tippers - Mon Mar 09 08:22:23 EDT 2009 Get it from svn over: http://sourceforge.net/projects/dxlstandardlib Regards, Mathias |
Re: XML Importer/Exporter Mathias Mamsch - Thu Mar 04 17:45:35 EST 2010 |
Re: XML Importer/Exporter Mathias Mamsch - Sat Mar 06 11:47:58 EST 2010 |
Re: XML Importer/Exporter Tippers - Tue Mar 23 08:29:06 EDT 2010 |
Re: XML Importer/Exporter Mathias Mamsch - Tue Mar 23 18:27:19 EDT 2010 Your standard library looks like a great idea -- I'm just getting into DXL for a commercial project and I would love to use it, but I don't think I can because of the license. If I understand correctly, the GPLv3 means that any script that uses your library must be distributed unencrypted and also under GPLv3; we could not charge for licenses of scripts developed that use the library. Is that right? Steve |
Re: XML Importer/Exporter SteveCooper - Mon May 24 08:51:08 EDT 2010
I think, that is not true. When I read it right, the GPL just needs you to spread the parts of the standard library that you use in your commercial application unencrypted. The rest of your application can be encrypted i think. If this is not correct I maybe need to rethink the license - it was always my intention to encourage the usage of the library for commercial use, as I hope that other companies might like to contribute to this library. Does the GPL allow me to sell copies of the program for money? Yes, the GPL allows everyone to do this. The right to sell copies is part of the definition of free software. Except in one special situation, there is no limit on what price you can charge. (The one exception is the required written offer to provide source code that must accompany binary-only release.)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: XML Importer/Exporter Mathias Mamsch - Mon May 24 09:08:51 EDT 2010
I think, that is not true. When I read it right, the GPL just needs you to spread the parts of the standard library that you use in your commercial application unencrypted. The rest of your application can be encrypted i think. If this is not correct I maybe need to rethink the license - it was always my intention to encourage the usage of the library for commercial use, as I hope that other companies might like to contribute to this library. Does the GPL allow me to sell copies of the program for money? Yes, the GPL allows everyone to do this. The right to sell copies is part of the definition of free software. Except in one special situation, there is no limit on what price you can charge. (The one exception is the required written offer to provide source code that must accompany binary-only release.)
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
You chose the GPLv3 for the project. Any code which uses GPLv3 must also be declared GPLv3. From the Gnu site (http://tinyurl.com/libisgpl): If a library is released under the GPL (not the LGPL), does that mean that any program which uses it has to be under the GPL or a GPL-compatible license? Yes, because the program as it is actually run includes the library. That means a programmer can't use your library and still sell software licenses. Fortunately for you, your own work isn't covered, so you can happily charge for your own scripts that use it. (http://tinyurl.com/9k86kh) For me, this means I can't use your software. The license that looks best, to me, is the Simplified BSD license. It is entirely permissive, and you can write a program which uses a BSD library without being constrained at all. Wikipedia says on http://tinyurl.com/bsdisok; The BSD License allows proprietary use, and for the software released under the license to be incorporated into proprietary products. Works based on the material may be released under a proprietary license or as closed source software. I would be very grateful if you were to consider changing the license. Right now, DXL is very, very new and I'm going to need to write some XML code, and your XML library looks perfect. Anyway, I hope this helps clarify what the GPLv3 means to users of the library, Steve Cooper |
Re: XML Importer/Exporter SteveCooper - Mon May 24 11:03:42 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: XML Importer/Exporter 1) DOORS 8.x is going obsolete soon, but our customer is going to continue using DOORS 8 as my company goes to DOORS 9 2) We use DOORS Project Archives (DPA) as deliverables with this customer, and DOORS 9 DPAs won't import into DOORS 8 3) DOORS 9 can natively export to RIF (XML), so a workaround to the above could be: a) export data from DOORS 9 to an XML file b) import that XML to DOORS 8 on a standalone work station with its own dummy server c) export the resulting modules to a DPA to deliver in DOORS 8 DPA format How can your tool be used to import XML data to a DOORS module? I see the XML example for creating XML data, but how can we read it into a DOORS module most efficiently? Jason |
Re: XML Importer/Exporter jhaury - Wed Dec 08 20:00:27 EST 2010 I guess it is pretty straight forward to put the information of a module to an XML using the library or creating a module from an XML. You would first create an empty module, then use the selectNodes function to select all Types (you will need an XPath expression depending on the XML file schema), create them, use selectNodes again to select all Attributes, create them too, them do the objects, the views, etc. However that is not what I had in mind for the DXL standard library. The idea for the DXL standard library is to have classes like ModuleTemplate, AttributeTemplate, TypeTemplate, ViewTemplate, ObjectTemplate, etc... which allow you to read the information of Modules/Attributes/Types/Views/Objects etc from a module to memory. On these data structures you can then do evaluations, modify them, or write them back to a(nother) module (enabling you to copy stuff between modules easily or doing migrations / data transformations). Additionally I plan to have an readFromXML and writeToXML. Unfortunally I still have no committed partners for the DXL standard library, thats why I am making no progress at the moment. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: XML Importer/Exporter Mathias Mamsch - Wed Dec 15 07:18:39 EST 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS If you have, would you mind sharing the method. Thanks |
Re: XML Importer/Exporter OurGuest - Wed Dec 15 14:06:04 EST 2010
Sure. The XMLDocument.inc does not yet wrap the complete MSDOM.DOMDocument API, so you need to add the following method:
XMLTag create_CDATASection (XMLDocument xd, Buffer b) {
if (null xd) { raiseError ("NULL Parameter", "XML Document"); return null XMLTag}
OleAutoObj objDoc = getOleHandle_ xd
if (null objDoc) { raiseError ("NULL Parameter", "XML Document"); return null XMLTag }
OleAutoObj oleNewTag = null
checkOLE ( oleMethod (objDoc, "createCDATASection", oleArgs <- (tempStringOf b), oleNewTag) )
if (null oleNewTag) { raiseError ("XML Error", "Could not create new CDATA section in XML document."); }
return create_XMLTag_ (xd, oleNewTag)
}
#include <lib/DXLstdlib.inc>
#include <lib/XMLDocument.inc>
// appends a person with name and telephone number to the xtPerson tag
void appendPerson (XMLTag xtPerson, string sGender, string sName, string sTelephone) {
XMLTag xt = appendTag(xtPerson, "Person")
setAttribute (xt, "Gender", sGender)
setText (appendTag (xt, "Name"), sName)
setText (appendTag (xt, "Phone"), sTelephone)
}
// create the XMLDocument
XMLDocument x = create_XMLDocument()
// create a node for our phonebook
XMLTag xtp = appendTag (x, "Phonebook")
Buffer b = create(); b += "<some CData> Stuff\001\007"
XMLTag v = create_CDATASection(x, b)
appendChild(xtp, v)
// insert some data
appendPerson ( xtp, "male", "Mr. Schmidt", "012-3456" )
appendPerson ( xtp, "female", "Mrs. Meyer", "056-7890" )
// print the generated XML
print getXML x
// make sure that the DXLDocument is always cleaned up after usage
delete_XMLDocument x
<Phonebook><![CDATA[<some CData[]> Stuff]]><Person Gender="male">...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: XML Importer/Exporter Mathias Mamsch - Wed Dec 15 18:32:36 EST 2010
Sure. The XMLDocument.inc does not yet wrap the complete MSDOM.DOMDocument API, so you need to add the following method:
XMLTag create_CDATASection (XMLDocument xd, Buffer b) {
if (null xd) { raiseError ("NULL Parameter", "XML Document"); return null XMLTag}
OleAutoObj objDoc = getOleHandle_ xd
if (null objDoc) { raiseError ("NULL Parameter", "XML Document"); return null XMLTag }
OleAutoObj oleNewTag = null
checkOLE ( oleMethod (objDoc, "createCDATASection", oleArgs <- (tempStringOf b), oleNewTag) )
if (null oleNewTag) { raiseError ("XML Error", "Could not create new CDATA section in XML document."); }
return create_XMLTag_ (xd, oleNewTag)
}
#include <lib/DXLstdlib.inc>
#include <lib/XMLDocument.inc>
// appends a person with name and telephone number to the xtPerson tag
void appendPerson (XMLTag xtPerson, string sGender, string sName, string sTelephone) {
XMLTag xt = appendTag(xtPerson, "Person")
setAttribute (xt, "Gender", sGender)
setText (appendTag (xt, "Name"), sName)
setText (appendTag (xt, "Phone"), sTelephone)
}
// create the XMLDocument
XMLDocument x = create_XMLDocument()
// create a node for our phonebook
XMLTag xtp = appendTag (x, "Phonebook")
Buffer b = create(); b += "<some CData> Stuff\001\007"
XMLTag v = create_CDATASection(x, b)
appendChild(xtp, v)
// insert some data
appendPerson ( xtp, "male", "Mr. Schmidt", "012-3456" )
appendPerson ( xtp, "female", "Mrs. Meyer", "056-7890" )
// print the generated XML
print getXML x
// make sure that the DXLDocument is always cleaned up after usage
delete_XMLDocument x
<Phonebook><![CDATA[<some CData[]> Stuff]]><Person Gender="male">...
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
Thanks for your method. I got it to work and then found another problem perhaps you have figured out. When CDATA contains richText values of Object Text that has carriage returns is restored to Object Text, the carriage returns are lost and also the first word after the carriage return is lost. Have you figured out the solution to this problem? Thanks in advance. |
Re: XML Importer/Exporter Tony_Goodman - Fri Mar 06 08:36:03 EST 2009 hello Did the xml importer was a official product as the accessory of DOORS? we have some xml files and ole files, and want to import the xml into DOORS, then export excel file! |