We help IT Professionals succeed at work.

Help with creating xml files from tables in an xml file

220 Views
Last Modified: 2014-05-04
Hi,

I have an xml files with multiple tables (i.e. Row1, Row2, Row3 etc..)

How do I create an multiple xml files for data Row1.xml, Row2.xml, Row3.xml?

Thanks,

Victor
Comment
Watch Question

CERTIFIED EXPERT

Commented:
The answer to this question highly depends on the format of the initial xml file.

You would better add here a sample initial xml and possibly if you like a requested output so we can provide a better answer.

Giannis
Fernando SotoRetired
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
Victor, can there be more then 1 Row1, Row2, Row3, ..., in the original XML document?
Retired
CERTIFIED EXPERT
Distinguished Expert 2017
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
Hi,

There are multiple records for each table, the tables in my actual project are not named Row(x), x = 1,2,3, just using Row as an example. I will try the code and get back toy you.

Thank you.

Victor
Fernando SotoRetired
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
To your statement, "my actual project are not named Row(x), x = 1,2,3, just using Row as an example", I understand X was meant to represent any character at the end.

Author

Commented:
Hi,

It works! Is there a way rename the xml file depending on the table? for example if table is Row1 name the xml file LinkFileCTRY, if Row2 name the xml LinkFileItemA?

Thank You.

Victor
Fernando SotoRetired
CERTIFIED EXPERT
Distinguished Expert 2017

Commented:
There is no way to infer that from the name Row1 or whatever the table name is to some other name. You would need to have some type of mapping function that would take in the name Row1 and return LinkFileCTRY as the file name to be used.

Author

Commented:
I think a way around would be the rename the file, for example if my file name is Row1.ml, I will rename it LinkRow1BEL.xml for BEL data.

Thanks,

Victor

Author

Commented:
Thank You!
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.