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

Interesting issue

Subject: Interesting issue
From: Nischal Muthana <nischal_muthana@xxxxxxxxx>
Date: Thu, 21 Nov 2002 22:25:37 -0800 (PST)
interesting issue
Hi All

I am transforming xml to xml using an xsl with Xalan
XSLT processor. But I am getting the resulting xml as
string instead of 

nodelist.

test.xsl
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:lxslt="http://xml.apache.org/xslt" 

xmlns:result="http://www.example.com/results"
extension-element-prefixes="result" version="1.0">
<xsl:output method="xml"/>
	<lxslt:component prefix="result"
functions="GetCopyBookData">
	<lxslt:script lang="javascript">
	function GetData(Data)
	{
		var x1 = 0;
		var x2 = 0;
		var result;
		for(var i = 1;i < 3; i++)
		{
			var s = "<Customers><FirstName>";
			x1 = x2;
			x2 = x1 + 15;
			s = s + Data.substring(x1,x2) + "</FirstName>";
			s = s + "<LastName>";
			x1 = x2;
			x2 = x1 + 1;
			s = s + Data.substring(x1,x2) + "</LastName>";
			s = s + "<StreetNum>";
			x1 = x2;
			x2 = x1 + 1;
			s = s + Data.substring(x1,x2) + "</StreetNum>";
			s = s + "<Street>";
 			x1 = x2;
			x2 = x1 + 1;
			s = s + Data.substring(x1,x2) + "</Street>";
			s = s + "<City>";
			x1 = x2;
			x2 = x1 + 1;
			s = s + Data.substring(x1,x2) + "</City>";
			s = s + "<State>";
			x1 = x2;
			x2 = x1 + 1;
			s = s + Data.substring(x1,x2) + "</State>";
			s = s + "<Zip>";
			x1 = x2;
			x2 = x1 + 1;
			s = s + Data.substring(x1,x2) + "</Zip>";
			result = result + s;
		}
		return result;
	}
	</lxslt:script>
	</lxslt:component>
	<xsl:template match="/">
		<xsl:variable name="Data" select="data"/>
		<xsl:value-of select="result:GetData($Data)"/>
	</xsl:template>
		
test.xml
<Customers>
<data>SudhakarJalli030719751809Bigbenddrmilpitasca95035Rajeevkasarabada032719751788lowerbenddrivesanjoseca94523</data>
</Customers>


Result.xml

<Customers>
	<FirstName>Sudhakar</FirstName>
	<LastName>Jalli</LastName>
	<DOB>03071975</DOB>
	<StreetNum>1809</StreetNum>
	<Street>BigBendDr</Street>
	<City>Milpitas</City>
	<State>CA</State>
	<Zip>95035</Zip>
</Customers>
	<FirstName>Rajeev</FirstName>
	<LastName>Kasarabada</LastName>
	<DOB>03271975</DOB>
	<StreetNum>1788</StreetNum>
	<Street>lowerbenddrive</Street>
	<City>sanjose</City>
	<State>CA</State>
	<Zip>94523</Zip>
</Customers>		

Thanks for your time
Nischal

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus ? Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.