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

WordML to XML Header Problem

Subject: WordML to XML Header Problem
From: "Byomokesh Sahoo" <sahoo.byomokesh@xxxxxxxxx>
Date: Mon, 13 Oct 2008 11:37:31 +0530
 WordML to XML Header Problem
Hi,

I am doing WordML to XML. I am getting header problem. I am trying
[xsl:for-each-group select="*" group-starting-with...] but could not
find out the right way.
Input XML
=======
<w:body><wx:sect><wx:sub-section>
<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00AD3645">
<w:pPr><w:pStyle w:val="ChapterLabel"/></w:pPr>
<w:r>
<w:t>1</w:t></w:r></w:p><aml:annotation aml:id="0"
w:type="Word.Bookmark.Start" w:name="OLE_LINK25"/><aml:annotation
aml:id="1" w:type="Word.Bookmark.Start"
w:name="OLE_LINK26"/></wx:sub-section><wx:sub-section>
<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00AD3645">
<w:pPr><w:pStyle w:val="ChapterTitle"/></w:pPr>
<w:r><w:t>A Brief Introduction</w:t></w:r><aml:annotation aml:id="0"
w:type="Word.Bookmark.End"/><aml:annotation aml:id="1"
w:type="Word.Bookmark.End"/></w:p>
<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00AD3645">
<w:pPr><w:pStyle w:val="BodyText"/></w:pPr>
<w:r><w:t>Active Directory (AD) is Microsoftbs network operating
system (NOS</w:t></w:r>
<w:r><w:fldChar w:fldCharType="begin"/></w:r>
<w:r><w:instrText>XE "operating systems:NOS"</w:instrText></w:r>
<w:r><w:fldChar w:fldCharType="end"/></w:r><w:r><w:t>), built on top
of enables administrators to manage enterprise-wide
info</w:t></w:r><w:r><w:t>rmation distributed.</w:t></w:r>
<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00AD3645"><w:pPr><w:pStyle
w:val="Heading1"/></w:pPr><w:r><w:t>Evolution of the Microsoft
NOS</w:t></w:r></w:p>
<w:p wsp:rsidR="00000000" wsp:rsidRDefault="00AD3645"><w:pPr><w:pStyle
w:val="BodyText"/></w:pPr>
<w:r>
<w:t>Network operating system</w:t></w:r>
<w:r></w:p></wx:sub-section></wx:sect></w:body>

Required Output
============
<chapter id="a brief introduction">
<label>1</label>
<title>A Brief Introduction</title>
<p>Active Directory (AD) is (NOSXE "operating systems:NOS"), built on
top of distributed.</p>
<section1>
<title>Evolution of the Microsoft NOS</title>
<p>Network operating system, or which various types of resources,
such as user, group, and</p>
<!--
<section2> or <section3> .....like this
-->
</section3>
</section2>
</section1>
</chapter>
==========
XSL
===
<xsl:template match="w:p">
    <xsl:for-each-group select="*"
group-starting-with="w:pPr/w:pStyle[@w:val='ChapterTitle']">
       <section1>
<xsl:value-of select="current-group()[1]" />
<title><xsl:value-of select="current-group()[2]" /></title>
           <xsl:for-each-group select="current-group()[position()
&gt; 2]" group-starting-with="w:pPr/w:pStyle[@w:val='Heading1']">
               <section2>
<xsl:value-of select="current-group()[1]"/>
<xsl:value-of select="current-group()[2]" />
                   <xsl:for-each-group
select="current-group()[position() &gt; 2]"
group-starting-ith="w:p[w:pPr/w:pStyle/@w:val='Heading1']">
       <section3>
<xsl:value-of select="current-group()[1]" />
<xsl:value-of select="current-group()[2]" />
       </section3>
                   </xsl:for-each-group>
 </section2>
           </xsl:for-each-group>
       </section1>
    </xsl:for-each-group>
</xsl:template>

Please anyone give me some guidance how could archive this.

Thanks
Byomokesh Sahoo

Om Trayambakam Yajaamahe Sugandhim Pushtivardhanam
Urvaarukamiva Bandhanan Mrytor Muksheeya Mamritaat

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.