[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Convert Word XML to Hierarchical XML using XSLT

Subject: Convert Word XML to Hierarchical XML using XSLT
From: "Rod Coate" <Rod.Coate@xxxxxxxxxxxxxxxxx>
Date: Fri, 16 Sep 2005 10:40:05 +0100
convert word xml
Hi,
This is my first post on this list and I need a bit of help with some XSL.

The tools I am using are word 2000 and Altova XML Spy.

I have a series of word documents that are formatted so that the import
function of XML Spy produces xml as per the example at the end of this post.
I am trying to process this into a specific xml so that I can then import it
into a database. (Target XML sample after the Word XML sample)

I need a bit of Guidance as to how to approach this problem. If I was coding
in VBA then I could just count and compare Heading levels, but how do I do
this in XSL?

I hope that this makes sense.

Help!

Rod

-------------------------------------------------------------
Word XML
-------------------------------------------------------------
<Word-Document >
	<Heading1>
		<p>Heading Level One</p>
	</Heading1>
	<Heading2>
		<p>Heading Level Two</p>
	</Heading2>
	<Heading3>
		<p>Category1</p>
	</Heading3>
	<Normal>
		<p>Category 1 Text</p>
		...
	</Normal>
	<Heading3>
		<p>Category2</p>
	</Heading3>
	<Normal>
		<p>Category 2 Text</p>
		...
	</Normal>
	...
	<Heading2>
	...
</Word-Document>
-------------------------------------------------------------
Target XML
-------------------------------------------------------------
<Heading1>
	<Title>Heading Level One</Title>
	<Data>
		<Heading2>Heading Level 2</Heading2>
		<Category1>
			Category 1 Text
			...
		</Category1>
		<Category2>
			Category 2 Text
			...
		</Category2>
		...
		<CategoryN>
			Category N Text
			...
		</CategoryN>
	</Data>
	<Data>
		...
	</Data>
</Heading1>
-------------------------------------------------------------

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.