This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Problem regarding getting complete Node with value


You should select the element of the DataSet element, not the DataSet
element itself. You can use following stylesheet:

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0"
				xmlns:java="http://xml.apache.org/xslt/java";
				exclude-result-prefixes="java">
				
<xsl:output method="xml" indent="yes"/>
<xsl:output encoding="ISO-8859-1"/>
<xsl:strip-space elements="*"/>

<xsl:template match="/">
	<xsl:apply-templates select="DataSet"/>
</xsl:template>

<xsl:template match="DataSet">
      <AccountDetails>
		<xsl:copy-of select="*" />
      </AccountDetails>
</xsl:template>
      
</xsl:stylesheet>

-----Original Message-----
From: Mukul.Mudgal@etindia.com [mailto:Mukul.Mudgal@etindia.com]
Sent: Wednesday, August 28, 2002 8:35 AM
To: XSL-List@lists.mulberrytech.com
Subject: [xsl] Problem regarding getting complete Node with value


Hi friends

I'm try to convert this

<DataSet XslFileName="AccountOpen.xsl">
      <SortCode Value="000002"/>
      <AccountNumber Value="123456789"/>
      <BranchCodeOrig Value="127"/>
      <ProductCode Value="101010"/>
      <JointMandate Value = "E"/>
      <OpenDate Value="0020730"/>
      <ACCRINTDATELAST Value="20020730" />
      <Balance Value="10"/>
</DataSet>

in to this
<AccountDetails>
      <SortCode Value="000002"/>
      <AccountNumber Value="123456789"/>
      <BranchCodeOrig Value="127"/>
      <ProductCode Value="101010"/>
      <JointMandate Value = "E"/>
      <OpenDate Value="0020730"/>
      <ACCRINTDATELAST Value="20020730" />
      <Balance Value="10"/>
</AccountDetails>

I'm using this xsl file

<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";
version="1.0"
xmlns:java="http://xml.apache.org/xslt/java";
exclude-result-prefixes="java">
<xsl:output method="xml" indent="yes"/>
<xsl:output encoding="ISO-8859-1"/>
<xsl:strip-space elements="*"/>
<xsl:template match="*">
            <AccountDetails>
<xsl:copy-of select="DataSet" />
      </AccountDetails>
      </xsl:template>
</xsl:stylesheet>

But after transformation it gives

<?xml version="1.0" encoding="ISO-8859-1"?>
<AccountDetails>
    <DataSet XslFileName="AccountOpen.xsl">
      <SortCode Value="000002"/>
      <AccountNumber Value="123456789"/>
      <BranchCodeOrig Value="127"/>
      <ProductCode Value="101010"/>
      <JointMandate Value="E"/>
      <OpenDate Value="0020730"/>
      <ACCRINTDATELAST Value="20020730"/>
      <Balance Value="10"/>
</DataSet>
</AccountDetails>

though above result is correct but I don't want the <DataSet/>  node. As
I've mentioned above in the required result file.

how could I get the required result,?? Please help....

Thanks
Mukul





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

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]