Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: dharm on July 17, 2012, 07:25:05 am

Title: Please Help - Importing an xml file for reference.
Post by: dharm on July 17, 2012, 07:25:05 am
Hi all, I hope some has overcome this problem. I have created an xml file that details the following:

<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="MessageCatalog.xsl"?>
<!-- messagecatalogue DTD -->
<MessageCatalog>
  <!-- Message Catalog Error Messages -->
  <Message-Reference>
    <MessageId>10001</MessageId>
    <message>National Insurance Number must be 9 characters.</message>
  </Message-Reference>
  <Message-Reference>
    <MessageId>10002</MessageId>
    <message>First 2 characters must be alpha</message>
  </Message-Reference>
  <Message-Reference>
    <MessageId>10003</MessageId>
    <message>chararcters 3 to 8 must be numeric</message>
  </Message-Reference>
</MessageCatalog>

I want to put it in EA so that the analysts can create the text for the messages and dev team can use it as a reference file in their code to get a specific message for a reference id

My EA knowledge is limited and I've been trying for too many hours now to work out how to do it :'(
I thought I'd put a post out here before I resort to creating a spreadsheet and putting it on sharepoint.

Many thanks inadvance
Title: Re: Please Help - Importing an xml file for refere
Post by: qwerty on July 17, 2012, 08:09:18 am
It would probably help if you explain what you want to see as a result for this import.

q.
Title: Re: Please Help - Importing an xml file for refere
Post by: Geert Bellekens on July 17, 2012, 03:37:32 pm
I'm guessing you somehow want to import this data into EA (as classes or attributes).
I think your options are:
Geert
Title: Re: Please Help - Importing an xml file for refere
Post by: dharm on July 17, 2012, 05:06:59 pm
Hi Thanks for the responses. What I would like to see in EA is a file that has a number of "key value pairs". I have an xsl that transforms this file into a html output that is useable by the business. But what I want is to set this up as a file in EA that a team of developers can use to reference in their code as our Use Cases will make reference to the message ID when certain conditions are triggered.
Title: Re: Please Help - Importing an xml file for refere
Post by: qwerty on July 17, 2012, 08:30:16 pm
In order to do that you need to write a script. Basically this would involve to synchronize tagged values of an file <<artifact>> in EA with the contents of your file. But as Geert suggests for simple key-value pairs a csv is also sufficient.

Another thought: if these key-value pairs are some kind of settings you can also create single class elements (key) with notes (value) in a package which your developers can refer to.

I don't know what these messages are. But eventually the are some kind of method of a class?

q.