Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > BOOK: Beginning XSLT and XPath : Transforming XML Documents and Data
|
BOOK: Beginning XSLT and XPath : Transforming XML Documents and Data
This is the forum to discuss the Wrox book Beginning XSLT and XPath : Transforming XML Documents and Data by Ian Williams ISBN: 978-0-470-47725-0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning XSLT and XPath : Transforming XML Documents and Data 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 August 4th, 2011, 07:22 AM
Registered User
 
Join Date: Aug 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default help needed for code to convert the plist to xml file and xml file to plistusing xsl

Hi ,
could any one post the answer with in one day or as soon as possible is a grate help for me..Thanks in advance
iam new to xsl..
i want to convert the plist using xsl to xml file as output.
i need xsl code for the given below plist to produce output as xml.
The Apple plist file format is a very special kind of xml, so I plan to convert it to a more standard XML file.

Plist code :

In this Plist,the xml output should work for boolean values and array values with seperator comma, .

For example :
Plist :
<key>booleanAnswer</key>
<false/>
<key>imageNameList</key>
<array>
<string>haiiimage</string>
<string>hellostringimage</string>
</array>

xsl :
xsl should parse plist in such a way that it works for boolean and array in a proper xml formatxml:
<booleanAnswer>false </booleanAnswer>
<imageNameList > haiimage , hellosringimage </imageNameLis>


Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>surveyUniqueIndentifier</key>
	<string></string>
	<key>storeId</key>
	<string></string>
	<key>answersList</key>
	<array>
		<dict>
			<key>questionId</key>
			<string>qid001</string>
			<key>categoryId</key>
			<string>cid001</string>
			<key>comments</key>
			<string>hai</string>
			<key>booleanAnswer</key>
			<false/>
			<key>imageNameList</key>
			<array>
				<string>helloimage</string>
				<string>haiimage</string>
			</array>
			<key>selectionList</key>
			<array>
				<string>1</string>
				<string>2</string>
			</array>
		</dict>
		<dict>
			<key>questionId</key>
			<string>qid002</string>
			<key>categoryId</key>
			<string>catid002</string>
			<key>comments</key>
			<string>hellocomments</string>
			<key>booleanAnswer</key>
			<false/>
			<key>imageNameList</key>
			<array>
				<string>haiiimage</string>
				<string>hellostringimage</string>
			</array>
			<key>selectionList</key>
			<array>
				<string>a</string>
				<string>b</string>
			</array>
		</dict>
		<dict>
			<key>questionId</key>
			<string>qid003</string>
			<key>categoryId</key>
			<string>catid003</string>
			<key>comments</key>
			<string>commwnt3</string>
			<key>booleanAnswer</key>
			<false/>
			<key>imageNameList</key>
			<array>
				<string>image1</string>
				<string>image2</string>
			</array>
			<key>selectionList</key>
			<array>
				<string>abc</string>
				<string>xyz</string>
			</array>
		</dict>
	</array>
</dict>
</plist>
Xsl I got from google ..but it should work for arrays and booleans.






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert this xml file into Target xml file using XSLT sudheer2250 XSLT 6 June 10th, 2011 01:46 PM
Convert XML file using XSLT sushil.sharma75 XSLT 13 November 20th, 2009 01:59 PM
Help needed to convert an XML file rpalmer68 XSLT 3 June 20th, 2009 11:45 PM
Help needed transforming plist to XML by XSL Vartan XSLT 4 September 28th, 2007 03:11 PM
biztalk convert a binary file to XML izakref Biztalk 0 March 15th, 2004 09:07 AM





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