Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8543119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:13:40+00:00 2026-06-11T12:13:40+00:00

I simply need to transforma XML document into a WordML document (if it is

  • 0

I simply need to transforma XML document into a WordML document (if it is possible to call it simple!) with this form (without processing instructions):

<body>
    <p>
        <r>This is the <italic>standard</italic> text run.</r> 
    </p>
</body>

The transformed XML should look like this, as per an WordML document:

<w:body>
    <w:p>
        <w:r>
            <w:t>This is the </w:t> 
        </w:r>
    </w:p>
    <w:p>
        <w:pPr>
            <w:i/>
        </w:pPr>
        <w:r>
            <w:t>standard</w:t> 
        </w:r>
    </w:p>
    <w:p>
        <w:r>
            <w:t> text run.</w:t> 
        </w:r>
    </w:p>
</w:body>

How should i create the XSLT transformation for properly handle the Italic tags??..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T12:13:41+00:00Added an answer on June 11, 2026 at 12:13 pm

    This transformation:

    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:w="some:w" exclude-result-prefixes="w">
     <xsl:output omit-xml-declaration="yes" indent="yes"/>
    
     <xsl:template match="body">
      <w:body>
       <xsl:apply-templates/>
      </w:body>
     </xsl:template>
    
     <xsl:template match="p/r/text()">
        <w:p>
            <w:r>
                <w:t><xsl:value-of select="."/></w:t>
            </w:r>
        </w:p>
     </xsl:template>
    
     <xsl:template match="p/r/italic/text()">
        <w:p>
            <w:pPr>
                <w:i/>
            </w:pPr>
            <w:r>
                <w:t><xsl:value-of select="."/></w:t>
            </w:r>
        </w:p>
     </xsl:template>
     <xsl:template match="text()"/>
    </xsl:stylesheet>
    

    when applied on the provided XML document:

    <body>
        <p>
            <r>This is the <italic>standard</italic> text run.</r>
        </p>
    </body>
    

    produces the wanted, correct result:

    <w:body xmlns:w="some:w">
       <w:p>
          <w:r>
             <w:t>This is the </w:t>
          </w:r>
       </w:p>
       <w:p>
          <w:pPr>
             <w:i/>
          </w:pPr>
          <w:r>
             <w:t>standard</w:t>
          </w:r>
       </w:p>
       <w:p>
          <w:r>
             <w:t> text run.</w:t>
          </w:r>
       </w:p>
    </w:body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to simply read an .xml file; like this: <exchanges> <exchange> <timestamp>2010-08-19 17:15:56</timestamp>
I need to transform one XML document into another using XSLT (for now from
Situation: I have a simple XML document that contains image information. I need to
I have a simple xml document that looks like the following snippet. I need
I've a need to display certain XML content in tabular form (XSL-FO for pdf
I need to loop a XML document. No problem there. The problem come when
OK, its Friday afternoon and I need to get this done: The following xml
I simply need to add floatArray1 to floatArray2 storing the result in floatArray2.. no
Simply I need to write echo t${count} = $t${count} To a text file, including
I need to simply wrap long text to display it in a few lines.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.