Book a Demo

Author Topic: Please Help - Importing an xml file for reference.  (Read 3344 times)

dharm

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Please Help - Importing an xml file for reference.
« 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

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Please Help - Importing an xml file for refere
« Reply #1 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.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Please Help - Importing an xml file for refere
« Reply #2 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:
  • Write a script to parse this xml and import it into EA
  • Transform your data into CSV and use the CSV import utility in EA
  • Transform your data into Excel and use my Simple VBA Excel to EA importer v2 to import it.
Geert

dharm

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Please Help - Importing an xml file for refere
« Reply #3 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.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Please Help - Importing an xml file for refere
« Reply #4 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.
« Last Edit: July 17, 2012, 08:31:30 pm by qwerty »