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 December 17th, 2007, 02:07 AM
Authorized User
 
Join Date: Nov 2007
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Anyone help on this XSLT coding

Hii,

The following is my Xml file:

<questions><question id="q1"><head>1.</head> <p>How is Indiana#x0027;s farming today like its early farming?</p></question>
<question id="q2"><head>2.</head> <p>How is Indiana#x0027;s farming today different from its early farming?</p></question></questions>
<answer idref="q1"><head>1.</head> <p>Many Indian farmers raise corn and hogs today, just as they did in the past.</p></answer>
<answer idref="q2"><head>2.</head> <p>Today, farmers raise other crops such as soybeans; farms are larger with fewer workers; modern machines have replaced wooden plows and picking corn by hand.</p></answer>

I want to convert this as

<list type="ol">
<li id="q1"><p>How is Indiana#x0027;s farming today like its early farming?</p></li>
<li id="q2"><p>How is Indiana#x0027;s farming today different from its early farming?</p></li></list>
<list type="ol">
<li id="q1"><p>Many Indian farmers raise corn and hogs today, just as they did in the past.</p></li>
<li id="q2"><p>Today, farmers raise other crops such as soybeans; farms are larger with fewer workers; modern machines have replaced wooden plows and picking corn by hand.</p></li></list>

Thanks in Advance,
srkumar
 
Old December 17th, 2007, 05:25 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

As well as giving your input and output, it's a good idea to explain where your difficulties lie. What have you already tried? From a quick look, I can't see anything about this problem that means it can't be solved by the basic technique of writing one template rule for each input element.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Anyone help on this xslt coding srkumar XSLT 3 January 3rd, 2008 07:44 AM
Good XSLT coding Architecture for transformation anil2020 XSLT 0 August 27th, 2007 12:10 PM
Coding question (New to XSLT) jcrowley XSLT 2 August 26th, 2007 03:42 PM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
can someone help me in coding this? somanchivasu Access 1 April 5th, 2004 02:41 PM





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