RE: RE: RE: RE: RE: [xsl] html tables with XSL

Subject: RE: RE: RE: RE: RE: [xsl] html tables with XSL
From: cknell@xxxxxxxxxx
Date: Fri, 20 Jan 2006 11:45:26 -0500
In your sample data you have this element:

<elementid>Template[0]/NAME[0]/Value</elementid>

In your schematic version of your desired output, I get the impression that you want to evaluate the string that is the text of the <elementid> element as if it were an XPath expression rather than reproducing the text itself. Is that correct?
-- 
Charles Knell
cknell@xxxxxxxxxx - email



-----Original Message-----
From:     Deepak <deepak_vn@xxxxxxxxx>
Sent:     Thu, 19 Jan 2006 02:06:06 -0800 (PST)
To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject:  RE: RE: RE: RE: [xsl] html tables with XSL

Hi Charles,
> Specifically, which elements in the input file
> provide the values for the output file?

I have to map caption and value from the editbox or a
normal element for each formelement node.

I have to order caption and value for Template[0] in
single column and profile[0] is on next column. Here
the xml file may contain more than one
profile(profile[1] or ..) for a single template . So i
have to display the table like

<table>
Template_Column                             
Profile_column
<row1>
caption : value(template[0]/name[0])
caption:value(profile[0])
caption : value(template[0]/name[1])
caption:value(profile[0])  
</>
<row2>
caption : value(template[0]/name[0])
caption:value(profile[1])
caption : value(template[0]/name[1])
caption:value(profile[1])    
</>
</>

I am not sure is that clear for you. Please let me
know if anything that you needed to solve my query.

Thanks and Regards,
Deepak



> 
> 
> -----Original Message-----
> From:     Deepak <deepak_vn@xxxxxxxxx>
> Sent:     Wed, 18 Jan 2006 07:10:41 -0800 (PST)
> To:       xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject:  RE: RE: RE: [xsl] html tables with XSL
> 
> Hi All,
> 
> Is somebody could help me to resolve the problem
> described in the below mail.
> 
> Thanks,Deepak
> 
> 
> --- Deepak <deepak_vn@xxxxxxxxx> wrote:
> 
> > > Thanks for the mail.
> > > 
> > > Actually my XML file is bit different that the
> > > sample
> > > file the i sent to you. It contains several
> nodes
> > > under 'FormElement' node, i think in that
> > situation
> > > that solution is not feasible.
> > > 
> > > <FormElements>
> > >   <FormElement version="0.1">
> > >      <value>
> > >        <editbox password="false">Sam</editbox>
> > >      </value>
> > >      <caption>Name</caption>
> > >     
> > > <elementid>Template[0]/NAME[0]/Value</elementid>
> > >    </FormElement>
> > >   <FormElement version="0.1">
> > >      <value>	<editbox
> > > password="false">Test</editbox></value>
> > >      <caption>Org</caption>
> > >     
> > > <elementid>Template[0]/NAME[1]/Value</elementid>
> > >   </FormElement>
> > >   <FormElement version="0.1">
> > >      <value>VALUE<value>
> > >      <caption>KeyValue</caption>
> > >     
> > > <elementid>Profile[1]/KeyValueString</elementid>
> > >   </FormElement>
> > >   <FormElement version="0.1">
> > >      <value>VALUE1<value>
> > >      <caption>KeyValue1</caption>
> > >     
> > >
> <elementid>Profile[1]/KeyValueInteger</elementid>
> > >   </FormElement>
> > >    <!-- continuing Profile[1]/ with another
> > > value............and will start with another
> > > Profile[2]-->
> > > </FormElements>
> > > 
> > > So i am trying put the values in the table like
> > >  
> > >   Column1    Column2
> > >   Name:Sam   KeyValue : Value for Profile1
> > >   Org :US    KeyValue1: Value for Profile1 
> > >   ---------------------------
> > >   Name: Sam  KeyValue : Value for Profile2
> > >   Org : US   KeyValue : Value for Profile2
> > > 
> > > Am not sure how we can solve this problem,
> please
> > > advice me.
> > > 
> > > Thanks & Regards,Deepak
> > > 
> > > 
> > > --- cknell@xxxxxxxxxx wrote:
> > > 
> > > > Attaching files is not a good idea. When we
> ask
> > > for
> > > > you to post a stylesheet or a data file or
> > > whatever,
> > > > just paste them into the body of the message.
> > > > 
> > > > That being said, given the data document you
> > > posted
> > > > today and the expected output you attached to
> > > > yesterday's message, I don't see how you can
> get
> > > the
> > > > output you asked for. Nonetheless, I took the
> > data
> > > > document you posted today and constructed a
> > > > stylesheet that produces an output of the
> format
> > > you
> > > > asked for yesterday, making allowances for the
> > > > difference in the string values of the
> elements
> > in
> > > > the input document versus the expected output
> in
> > > > yesterday's attachment.
> > > > 
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > > <xsl:stylesheet version="1.0"
> > > >
> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> > > > 
> > > >   <xsl:template match="/">
> > > >     <table border="1">
> > > >       <TR>
> > > >         <TH COLSPAN="1"
> > > bgcolor="#E0E0E0">Name</TH>
> > > >         <TH COLSPAN="1" bgcolor="#E0E0E0">Key
> > > > Properties</TH>
> > > >         <TH COLSPAN="1"
> > > > bgcolor="#E0E0E0">checkthis</TH>
> > > >       </TR>
> > > >       <xsl:apply-templates />
> > > >     </table>
> > > >   </xsl:template>
> > > >   
> > > >   <xsl:template match="Formelements">
> > > >     <xsl:apply-templates />
> > > >   </xsl:template>
> > > >   
> > > >   <xsl:template
> > > >
> match="Form[contains(elementid,'properties')]">
> > > >     <tr>
> > > >       <td bgcolor="#F0F8FF">
> > > >         <ul>
> > > >           <li>
> > > >             Name: <xsl:value-of
> > > >
> > >
> >
>
select="preceding-sibling::Form[contains(elementid,'name')]"
> > > > />
> > > >           </li>
> > > >           <li>
> > > >             Address: <xsl:value-of
> > > >
> > >
> >
>
select="preceding-sibling::Form[contains(elementid,'address')]"
> > > > />
> > > >           </li>
> > > >         </ul>
> > > >       </td>
> > > >       <td bgcolor="#F0F8FF"><ul><li>Key
> > > > Prop:<xsl:value-of select="."
> /></li></ul></td>
> > > >       <td><input type="radio" name="group1"
> > > > value="check" bgcolor="#F0F8FF">check
> > > > this</input></td>
> > > >     </tr>
> > > >   </xsl:template>
> > > >   
> > > >   <xsl:template
> > > >
> > >
> >
>
match="Form/elementid[not(contains(elementid,'properties'))]"
> > > > />
> > > > 
> > > > </xsl:stylesheet>
> > > > -- 
> > > > Charles Knell
> > > > cknell@xxxxxxxxxx - email
> > > > 
> > > > 
> > > 
> > > 
> 
=== message truncated == 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Current Thread
  • RE: RE: RE: [xsl] html tables with XSL, (continued)
        • Deepak - Fri, 13 Jan 2006 07:13:41 -0800 (PST)
        • Deepak - Wed, 18 Jan 2006 07:10:41 -0800 (PST)
    • cknell - Wed, 18 Jan 2006 16:37:12 -0500
      • Deepak - Thu, 19 Jan 2006 02:06:06 -0800 (PST)
    • cknell - Fri, 20 Jan 2006 11:45:26 -0500 <=
      • Deepak - Fri, 20 Jan 2006 15:28:30 -0800 (PST)
        • Deepak - Tue, 24 Jan 2006 07:28:43 -0800 (PST)
    • cknell - Wed, 25 Jan 2006 10:52:45 -0500