XML Importer/Exporter

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.

Regards,
Raj
SystemAdmin - Tue Mar 03 01:42:27 EST 2009

Re: XML Importer/Exporter
SystemAdmin - Fri Mar 06 07:41:21 EST 2009

Could anyone answer for my question?

Re: XML Importer/Exporter
Tony_Goodman - Fri Mar 06 08:36:03 EST 2009

SystemAdmin - Fri Mar 06 07:41:21 EST 2009
Could anyone answer for my question?

I do, and so do others I suspect, but at the moment it is too valuable to just give away. Telelogic..err...IBM have an XML exporter/importer and they want paying for it too. Sorry.

Re: XML Importer/Exporter
Tippers - Mon Mar 09 08:22:23 EDT 2009

Tony_Goodman - Fri Mar 06 08:36:03 EST 2009
I do, and so do others I suspect, but at the moment it is too valuable to just give away. Telelogic..err...IBM have an XML exporter/importer and they want paying for it too. Sorry.

Tony's right. And I don't have an exporter, but I don't have a problem with you knowing about the undocumented domain object model types, perms and loop, which will certainly help on the import side. I have no idea now where these came from, and I'm also fairly sure it's not a complete list, but it might help...

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
kbmurphy - Mon Mar 09 16:43:09 EDT 2009

Tony_Goodman - Fri Mar 06 08:36:03 EST 2009
I do, and so do others I suspect, but at the moment it is too valuable to just give away. Telelogic..err...IBM have an XML exporter/importer and they want paying for it too. Sorry.

Yeah, why on earth should we expect such advanced things like XML import and export from a $5k+ per license piece of software for free? I mean, it's not like we pay maintenance fees.

Re: XML Importer/Exporter
Tippers - Thu Mar 04 05:50:08 EST 2010

Tippers - Mon Mar 09 08:22:23 EDT 2009
Tony's right. And I don't have an exporter, but I don't have a problem with you knowing about the undocumented domain object model types, perms and loop, which will certainly help on the import side. I have no idea now where these came from, and I'm also fairly sure it's not a complete list, but it might help...

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...

A year down the line, and I need to do the export thing as well. Does anyone have a list of perms for export like the list here for import?

Re: XML Importer/Exporter
Mathias Mamsch - Thu Mar 04 17:45:35 EST 2010

Tippers - Mon Mar 09 08:22:23 EDT 2009
Tony's right. And I don't have an exporter, but I don't have a problem with you knowing about the undocumented domain object model types, perms and loop, which will certainly help on the import side. I have no idea now where these came from, and I'm also fairly sure it's not a complete list, but it might help...

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...

I am starting to build an opensource DXL library at sourceforge at the moment. While it is still in a pre-release stage there is already a very functional XML library in there. The library is well documented and there are also tests (so it seems to work), so you might want to check it out.

Get it from svn over:

http://sourceforge.net/projects/dxlstandardlib

Regards, Mathias

Re: XML Importer/Exporter
Mathias Mamsch - Sat Mar 06 11:47:58 EST 2010

Mathias Mamsch - Thu Mar 04 17:45:35 EST 2010
I am starting to build an opensource DXL library at sourceforge at the moment. While it is still in a pre-release stage there is already a very functional XML library in there. The library is well documented and there are also tests (so it seems to work), so you might want to check it out.

Get it from svn over:

http://sourceforge.net/projects/dxlstandardlib

Regards, Mathias

I figured not everybody has subversion installed, so I put a zip file up for download. For feature requests or anything use the sourceforge forums, trackers, etc. Regards, Mathias

Re: XML Importer/Exporter
Tippers - Tue Mar 23 08:29:06 EDT 2010

Mathias Mamsch - Sat Mar 06 11:47:58 EST 2010
I figured not everybody has subversion installed, so I put a zip file up for download. For feature requests or anything use the sourceforge forums, trackers, etc. Regards, Mathias

Just heard back from a colleague who took over on this task, and he says "thanks very much for the info about XML ... very useful scripts".

Re: XML Importer/Exporter
Mathias Mamsch - Tue Mar 23 18:27:19 EDT 2010

Tippers - Tue Mar 23 08:29:06 EDT 2010
Just heard back from a colleague who took over on this task, and he says "thanks very much for the info about XML ... very useful scripts".

Nice to hear that! The official first release of the DXL standard library will probably be in 2-3 month (since I am doing that in my spare time). At this time I will have finished the developer help and found time to add some more library functions. If your colleague wants to contribute back you can tell him to message me ;-) Regards, Mathias

Re: XML Importer/Exporter
SteveCooper - Mon May 24 08:51:08 EDT 2010

Mathias Mamsch - Tue Mar 23 18:27:19 EDT 2010
Nice to hear that! The official first release of the DXL standard library will probably be in 2-3 month (since I am doing that in my spare time). At this time I will have finished the developer help and found time to add some more library functions. If your colleague wants to contribute back you can tell him to message me ;-) Regards, Mathias

Hi, Mathias.

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
Mathias Mamsch - Mon May 24 09:08:51 EDT 2010

SteveCooper - Mon May 24 08:51:08 EDT 2010
Hi, Mathias.

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

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.

Citing the GPL License FAQ:
 

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.)

 


But you might want to check this more thoroughly. Please report the result here.

Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: XML Importer/Exporter
SteveCooper - Mon May 24 11:03:42 EDT 2010

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.

Citing the GPL License FAQ:
 

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.)

 


But you might want to check this more thoroughly. Please report the result here.

Regards, Mathias

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Hi, Mathias. Thanks for the quick response. I'm not a lawyer, but I have looked at the different licenses and tried to find out what's what.

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
Mathias Mamsch - Mon May 24 15:06:47 EDT 2010

SteveCooper - Mon May 24 11:03:42 EDT 2010
Hi, Mathias. Thanks for the quick response. I'm not a lawyer, but I have looked at the different licenses and tried to find out what's what.

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

I opened a separate thread for the license question, as your post raises some more questions ... Regards, Mathias

Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

Re: XML Importer/Exporter
jhaury - Wed Dec 08 20:00:27 EST 2010

Wow Mathias, you've don't a lot of work! I came across your project when trying to solve this problem:

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
Mathias Mamsch - Wed Dec 15 07:18:39 EST 2010

jhaury - Wed Dec 08 20:00:27 EST 2010
Wow Mathias, you've don't a lot of work! I came across your project when trying to solve this problem:

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

Actually it was not a real lot of work, probably 3-4 days (made over christmas last year). I always wanted to extend the XML library to be able to export / import DOORS modules from XML. It is a really straight forward process, and I already have a part of the code for it, but I never came around to put it in the library and document it, since I was busy with the DXL debugger.

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
OurGuest - Wed Dec 15 14:06:04 EST 2010

Mathias Mamsch - Wed Dec 15 07:18:39 EST 2010
Actually it was not a real lot of work, probably 3-4 days (made over christmas last year). I always wanted to extend the XML library to be able to export / import DOORS modules from XML. It is a really straight forward process, and I already have a part of the code for it, but I never came around to put it in the library and document it, since I was busy with the DXL debugger.

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

Mathias, Have you by chance developed a method to inserter createCDATASection for you xml.inc file.

If you have, would you mind sharing the method.

Thanks

Re: XML Importer/Exporter
Mathias Mamsch - Wed Dec 15 18:32:36 EST 2010

OurGuest - Wed Dec 15 14:06:04 EST 2010
Mathias, Have you by chance developed a method to inserter createCDATASection for you xml.inc file.

If you have, would you mind sharing the method.

Thanks

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) 
}

 


Then a modified XML example could look like:

 

 

 

#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

 


This yields for me:

 

 

 

 

 

 

 

 

<Phonebook><![CDATA[<some CData[]> Stuff]]><Person Gender="male">...

 

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Re: XML Importer/Exporter
OurGuest - Thu Dec 16 13:08:19 EST 2010

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) 
}

 


Then a modified XML example could look like:

 

 

 

#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

 


This yields for me:

 

 

 

 

 

 

 

 

<Phonebook><![CDATA[<some CData[]> Stuff]]><Person Gender="male">...

 

 

 

 


Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS

 

 

Mathias,

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
Vincentlee - Fri Apr 22 00:05:58 EDT 2016

Tony_Goodman - Fri Mar 06 08:36:03 EST 2009
I do, and so do others I suspect, but at the moment it is too valuable to just give away. Telelogic..err...IBM have an XML exporter/importer and they want paying for it too. Sorry.

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!