473,326 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

how to convert XML document to several XML documents in a new format

I'm migrating data into a content management system and in order to use
the import tool provided I need to change the format of a large xml
file and convert each entry to a seperate xml file.

This is what I have now:
<?xml version="1.0" encoding="UTF-8" ?>

<dataroot xmlns:od="urn:schemas-microsoft-com:officedata"
generated="2005-04-18T12:05:51">
<Checklist>
<ID>1</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>2</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>3</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
<Checklist>
<ID>4</ID>
<Category>stuff</Category>
<Type>stuff</Type>
<Item>stuff</Item>
<Steps>stuff</Steps>
</Checklist>
</dataroot>

This is what I need each entry to be as a single file:

<?xml version="1.0" ?>
<file DocType="TypeName" DocTitle="TITLE:testing 123"
DocDesc="TITLE:testing 123">
<section name="Category">
<![CDATA[
stuff
]]>
</section>
<section name="Type">
<![CDATA[
stuff
]]>
</section>
<section name="Item">
<![CDATA[
stuff
]]>
</section>
<section name="SLA">
<![CDATA[
stuff
]]>
</section>
<section name="Troubleshooting Steps">
<![CDATA[
stuff
]]>
</section>
</file>

I need some direction on how to accomplish this task...

Jul 20 '05 #1
2 1410


en*****@gmail.com wrote:
I'm migrating data into a content management system and in order to use
the import tool provided I need to change the format of a large xml
file and convert each entry to a seperate xml file.


XSLT 1.1 respectively 2.0 can produce multiple output documents so you
could look at an XSLT processor which implements 1.1 or 2.0 or its own
extension function to produce multiple output documents.

Saxon 6.5 implements XSLT 1.1, Saxon 8 implements 2.0, info is here
<http://saxon.sourceforge.net/>

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 20 '05 #2
If you actually need to perform formatting of the text, try TEXTools.
It's an inexpensive shareware product designed for heavy-duty text
processing that might do the trick for you. Instead of declaring
variables, creating loops, etc., you simply combine filters into a
"pipe" that, when executed, does all the text processing work for
you... You can find TEXTools at www.fireflysoftware.com. Best of
luck!

Barry Block
Firefly Software

Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: mave | last post by:
Is anyone aware of a Java program preferably w/ source code to convert files in text format to xml format? Pls. let me know if you are aware of such a program.
0
by: enyetor | last post by:
I'm migrating data into a content management system and in order to use the import tool provided I need to change the format of a large xml file and convert each entry to a seperate xml file. ...
3
by: svdh2 | last post by:
I have been looking at a problem the entire week in access, I have still not been able to find a solution. Hope that you could maybe tell where to look Concerns the link between Access and Word....
4
by: sandy82 | last post by:
Hi all i want to convert a document from one format to pdf . A typical situation like we have a document of a type .abc and upon user request we convert it to .pdf . Here what i thought that...
6
by: Bob Alston | last post by:
I am looking for others who have built systems to scan documents, index them and then make them accessible from an Access database. My environment is a nonprofit with about 20-25 case workers who...
10
by: Antoine De Groote | last post by:
Hi there, I have a word document containing pictures and text. This documents holds several 'ABCDEF' strings which serve as a placeholder for names. Now I want to replace these occurences with...
6
by: Justin | last post by:
Hi all, i need some help over here... i found the solution to export file from mysql db into *.csv. but is there anyway to convert the contents into *.doc and save in my webserver and providing a...
8
by: Franck | last post by:
Hi, I'm lookin for an external tool which could convert any type of documents to pdf from server. (with as much functionnalities as possible : schedule, pooling, multi thread, embedding font,...
0
by: Mark Rae [MVP] | last post by:
<peterkoman@gmail.comwrote in message news:58799c82-3e72-46a9-81ad-fce678662881@t41g2000hsc.googlegroups.com... I'm not aware of any easy way to do this in .NET. However, the next version of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.