Subject: [xsl] RE: Help needed to transform in data joining From: "Kota, Ganesh" <gkota@xxxxxxxx> Date: Mon, 6 Nov 2006 11:40:02 -0500 |
My sample test stylesheet is <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:envelope="http://schemas.xmlsoap.org/soap/envelope/"> <xsl:key name="DCHorseID" match="/test/results/processRequestsAsDOMResponse/result/server/response s/Session.getDocumentRs/session/data/equinedata/coverages/horse" use="@id"/> <!-- <xsl:key name="DCHorseID" match="//horse" use="@id"/>--> <xsl:template match="/"> <session> <xsl:value-of select="key('DCHorseID', 'h1')"/> <data> <quote> <quotedetail> <quotedetailrisk> <xsl:for-each select="test/results/envelope:Envelope/envelope:Body/session/data/quote/ quotedetail/quotedetailrisk/animalquotedetailrisk"> <xsl:variable name="UIHorseID"> <xsl:value-of select="@id"/> </xsl:variable> <animalquotedetailrisk> <horse><xsl:value-of select="$UIHorseID"/></horse> <ratinganimalcoverage> <xsl:attribute name="id"> <xsl:value-of select="ratinganimalcoverage/@id"> </xsl:value-of> </xsl:attribute> <ratingasd> <xsl:attribute name="id"> <xsl:value-of select="ratinganimalcoverage/ratingasd/@id"> </xsl:value-of> </xsl:attribute> <baseRate> <xsl:value-of select="key('DCHorseID', $UIHorseID)/HorsePrivateASnDRate"/> </baseRate> </ratingasd> </ratinganimalcoverage> </animalquotedetailrisk> </xsl:for-each> </quotedetailrisk> </quotedetail> </quote> </data> </session> </xsl:template> </xsl:stylesheet> It's not retrieving the value from the key of DCHorseID.I will appreciate if you point me here. Thanks, Ganesh -----Original Message----- From: Kota, Ganesh Sent: Monday, November 06, 2006 9:41 AM To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' Subject: RE: Help needed to transform in data joining Thanks guys for your transformations. These transformations helped me up to some extent but It's not fully done. 1) Address child element data needs to be copied only if child element data of SBSaddress_ element doesn't exist. 2) This template driven approach may not work for my transformation as my source XML document has 2000 elements in it. I need to do with fill in the blanks design pattern with out using templates. 3) Does xsl:key help me to do this ? Thanks again for your help, Kota -----Original Message----- From: Kota, Ganesh Sent: Thursday, November 02, 2006 10:19 AM To: 'xsl-list@xxxxxxxxxxxxxxxxxxxxxx' Subject: Help needed to transform in data joining Hi, I have this XML file , need to do union of all Address and SBSaddress_ elements based on id attribute join condition in XSL file .Address element has to be overridden in the output if SBSaddress has the data. I appreciate if anybody can help and give some references on this. Thanks, Kota Input XML file: <root> <A> <B> <ADDRESSES> <ADDRESS id='1'><State>CO</State><Address1/><Address2/><City>flroen</City><Countr y>UnitedStates</Country><Province>--Select--</Province><ZipCode>11</ZipC ode><County/></ADDRESS> <ADDRESS id='2'><State>KY</State><Address1>campbellcounty</Address1><Address2/><C ity>fortthomas</City><Country>UnitedStates</Country><Province>--Select-- </Province><ZipCode>41075</ZipCode><County/></ADDRESS> </ADDRESSES> </B> </A> <c> <addresslists> <SBSaddress_ id='1'><State>CO</State><Address1>florence</Address1><Address2/><City>fl roen</City><Country>UnitedStates</Country><Province>--Select--</Province ><ZipCode>11</ZipCode><County/></SBSaddress_> <SBSaddress_ id='2'><State></State><Address1></Address1><Address2>bananacounty</<Addr ess2><City>fortthomas</City><Country>UnitedStates</Country><Province>--S elect--</Province><ZipCode>11</ZipCode><County/></SBSaddress_> </addresslists> </c> </root> ***************************************************************************** ******* The content of this e-mail message and any attachments are confidential and may be legally privileged, intended solely for the addressee. If you are not the intended recipient, be advised that any use, dissemination, distribution, or copying of this e-mail is strictly prohibited. If you receive this message in error, please notify the sender immediately by reply email and destroy the message and its attachments. ***************************************************************************** *******
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] RE: Help needed to transform , Kota, Ganesh | Thread | [xsl] RE: Help needed to transform , Kota, Ganesh |
Re: [xsl] i18n and l10n question, David Carlisle | Date | Re: [xsl] odf2xhtml: Processing nes, Wendell Piez |
Month |