Link to home
Start Free TrialLog in
Avatar of namshi5
namshi5

asked on

How to convert xml from one format to another?

I am a Tester and our company bought  a new Test management tool and we are trying to migrate the testcase from the old tool to the new one.
However the output xml of the old tool is not compatible with the new one and I am looking for a solution to convert the old xml to the new format.

I have attached the xml's from both the tools and would highly appreciate if anyone could help me out in this task.



old.xml
new.xml
ASKER CERTIFIED SOLUTION
Avatar of kmartin7
kmartin7
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I forgot to add the DTD declaration, so change the xsl:output to look like this:

<xsl:output indent="yes" method="xml" encoding="utf-8" doctype-system="TestTrackData.dtd"/>
Avatar of namshi5
namshi5

ASKER

Thanks a Lot !! I will try it out on the tool XMLwriter and will let you know how it went.


Cheers

Nams
Avatar of namshi5

ASKER

Hi,
    I am still struggling with the conversion (I am very bad at this)...Could you give me a step by step guide on how I could do this. I am using a tool called Stylus Studio.

Also there are 100's of xml's to be reformatted, how can I do this in a Batch mode?


Regards

Nams
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of namshi5

ASKER

Hi,
   I tried it and got the below exception.

 at: file:///c:/Users/NAMSHI%7E1/Desktop/TESTTR%7E1/STYLES%7E2.XSL 1
java.lang.RuntimeException: Error: on line 1 column 2 of file:///c:/Users/NAMSHI%7E1/Desktop/TESTTR%7E1/STYLES%7E2.XSL:
  SXXP0003: Error reported by XML parser: The markup in the document preceding the root element must be well-formed.

      at com.exln.stylus.CSaxon8Driver.doProcessing(CSaxon8Driver.java:269)
      at com.exln.stylus.CProcessorDriver.process(CProcessorDriver.java:104)
stylesheet_new.xsl (1, 2)
Error: on line 1 column 2 of file:///c:/Users/NAMSHI%7E1/Desktop/TESTTR%7E1/STYLES%7E2.XSL:   SXXP0003: Error reported by XML parser: The markup in the document preceding the root element must be well-formed.


Its obviously a parsing error, but I am not able to correct it.

Do you have a gmail / skype ID so you could help me out.
Mine is namshi5@gmail.com and skype: namshi5
I don't have access to those at work. Please send me your XML and XSLT files: kmartin7@gmail.com
Hi namshi5,

I got your email and tried your XML & XSLT, and didn't find any problems running it. As a result, it is hard to day exactly what the problem is.

Try changing the parser (edit scenario properties > processor tab) and see what error you get.

kmartin7
Avatar of namshi5

ASKER

Hi Martin,
         Finally Managed to convert the files...Cant thank you enough...

Regards

Nams
You're welcome. If you are satisfied, please grade and close this question.

Regards.
Avatar of namshi5

ASKER

martin provided a thorough and informative answer to my question.