Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: preceding not working...can anybody help

From: "Anthony Jones" <Ant@------------.--->
To: NULL
Date: 7/3/2006 8:27:00 AM


<prateekbaxi@g...> wrote in message
news:1151659069.676709.44770@p......
> Super....u r a genious....master of all in XPath and XSL....
>

Umm.. thanks :) but there are chaps who post here who know way more than me.

> u hv saved my day...mate...
>
> thanks a lot...
>
> Anthony Jones wrote:
> > <prateekbaxi@g...> wrote in message
> > news:1151594703.498062.159730@i......
> > > Hi,
> > >
> > > Thanks...yeah ur very correct...this approch is much faster then one I
> > > was using...I m now goign to use the one suggested by you...can you
> > > tell me what this approch is called...
> > >
> >
> > Some refer to it as the Muenchian method.
> >
> > > one more...now i have to extend this XSL such that it can produce
> > > follwing output
> > > <Products>
> > >     <Product id="111" description="xx" price="33" expiry="sdf">
> > >          <Services>
> > >               <Service id="1" description="TV"
> > > longcommoditydescription="sdg" shortcommoditydescription ="sdfsdf">
> > >               <Service id="2" description="TV"
> > > longcommoditydescription="sdg" shortcommoditydescription ="sdfsdf">
> > >          </Services>
> > >     </Product>
> > >     <Product id="141" description="xx" price="33" expiry="sdf">
> > >          <Services>
> > >               <Service id="1" description="TV"
> > > longcommoditydescription="sdg" shortcommoditydescription ="sdfsdf">
> > >               <Service id="2" description="TV"
> > > longcommoditydescription="sdg" shortcommoditydescription ="sdfsdf">
> > >          </Services>
> > >     </Product>
> > >     <Product id="145" description="xx" price="33" expiry="sdf">
> > >          <Services>
> > >               <Service id="1" description="TV"
> > > longcommoditydescription="sdg" shortcommoditydescription ="sdfsdf">
> > >               <Service id="2" description="TV"
> > > longcommoditydescription="sdg" shortcommoditydescription ="sdfsdf">
> > >          </Services>
> > >     </Product>
> > > </Products>
> > >
> > > pls not data shown in above example is not matching the XML data. I
> > > have done this as to give an example only in reality i am goign to use
> > > the value hold by the xml element.
> > >
> > > Is this possible?? How? I want to generate <Service> for all the
> > > element of Table1 but Product is not for unique id. Note that
<service>
> > > is under product
> > >
> >
> > Not entirely sure I understand but does this do what you want:-
> >
> > <?xml version="1.0" encoding="UTF-8"?>
> > <xsl:stylesheet version="1.0"
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> >  <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
> >  <xsl:key name="Products" match="Table1" use="ProductId" />
> >
> >  <xsl:template match="NewDataSet" name="productList">
> >   <Products>
> >    <xsl:for-each select="Table1[count(key('Products', ProductId)[1] | .)
> > =1]">
> >     <Product id="{ProductId}" description="{ProductDescription}"
> > price="{ProductPrice}" expiry="{ProductExpiry}">
> >      <Services>
> >       <xsl:for-each select="key('Products',ProductId)">
> >        <Service id="{ServiceId}" description="{ServiceDescription}"
> > longcommoditydescription="{LongCommodityDesc}"
> > shortcommoditydescription="{ShortCommodityDesc}"
> >       </xsl:for-each>
> >      </Services>
> >     </Product>
> >    </xsl:for-each>
> >   </Products>
> >  </xsl:template>
> > </xsl:stylesheet>
> >
> > You might consider using shorter attribute names if this set to data is
> > large.
> >
> > Anthony
>




transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent