Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 22nd, 2004, 07:47 AM
Authorized User
 
Join Date: Jun 2003
Posts: 42
Thanks: 0
Thanked 0 Times in 0 Posts
Default Converting XHTML to Word ML using XSLT

Hi Friends,

I'm creating a XSL file wherein I'm applying some XSL Transformation to XML document. Now, the XML file contains various nodes like Detail, ImplementationNotes, etc. I have to apply Word Styles to the content of these nodes(Detail, ImplmentationNotes, etc.). Now, the content of these nodes may also contain XHTMLs like Tables, Bulleted Lists, etc. other than simple text. If I simply apply Word Styles to the content of a node containing Tables or Bulleted Lists, they don't appear properly. I have to convert the XHTML to corresponding Word ML so that the Tables or Bulleted List appear properly when the XSLT is applied to the XML document and displyed in MS Word. Now the problem I'm facing is that I'm not able to know what the content of a particular node in XML document contains. Also a Word Style tag is applied on the whole node content not partly...So in that case how can I apply different Word Styles to a single node content...I have the Word Styles for the Tables and Bulleted List but I can't understand how I can apply different Word Styles to a single node content so that the Text in the content appear in the corresponding Word Style, the Table in the content appear in the corresponding Word Style, and so on....

Any help will be appreciated.

Cheers,
Debsoft
__________________
cheers,
debsoft
 
Old July 7th, 2004, 04:36 AM
Authorized User
 
Join Date: Jul 2004
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to NotesSensei Send a message via Yahoo to NotesSensei
Default

Hi Debsoft,
First: are you really going to convert html to Word ML the hard way? If you use a XLST transformation and then just open the document in Word it will convert allright... and it would word in more versions of word, not just 2003.
For the question: When you define a xslt template for possible elements inside your XML tags, then they are ignored when there is no such element and executed if there is one (Same applies for CSS stylesheets). So you could have
<xsl:template match="req:Detail/table"> ...
Take note: when you mix and match XML styles you need to specify namespaces.
Hth
;) stw

If you think education is expensive - try ignorance!





Similar Threads
Thread Thread Starter Forum Replies Last Post
XSLT for parsing XHTML Form shahbhat XSLT 6 August 26th, 2008 06:22 PM
xhtml input tag not rendered correctly by xslt dude153 XSLT 4 December 14th, 2007 02:04 PM
xslt -> xhtml validation rahulsk1947 XSLT 3 May 17th, 2007 02:54 AM
producing XHTML from XSLT holdmykidney XSLT 1 August 24th, 2004 09:00 AM
XHTML to Word ML using XSLT debsoft XSLT 0 June 26th, 2004 04:53 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.