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

selecting values from multiple lists and displaying th

Subject: selecting values from multiple lists and displaying them.
From: Prashant Bhalesain <prashb2000@xxxxxxxxx>
Date: Thu, 20 Jan 2005 08:32:35 -0800 (PST)
ecntype
Hi


 

I am really a beginner in xsl so please forgive me if
this is very obvios and esay problem. Please help me
to solve this problem. I couldnt find any such case
which can help me out.
 
I have this type of xml.
<Company>

<Person Manager="true" Degree="BA" >

 <First>Dan</First>

 <Last>McGre</Last>

 <PhoneExt>21</PhoneExt>

 <Email>pbhalesain</Email>

 <Attribute Name="ECNType" type="List">

   <List>

      <ListMember type="string">1</ListMember>

      <ListMember type="string">2</ListMember>

      <ListMember type="string">3</ListMember>

      <ListMember type="string">4</ListMember>

  </List>

   </Attribute>

   <Attribute Name="ECNCode" type="List">

   <List>

      <ListMember type="string">5</ListMember>

      <ListMember type="string">6</ListMember>

      <ListMember type="string">7</ListMember>

       <ListMember type="string">8</ListMember>

   </List>

   </Attribute>

   <Attribute Name="RFQType" type="List">

   <List>

       <ListMember type="string">9</ListMember>

       <ListMember type="string">10</ListMember>

        <ListMember type="string">11</ListMember>

         <ListMember type="string">12</ListMember>

    </List>

   </Attribute>

   </Person>

</Company>

 

And I have to print it this way

First   Last     Ext.    Email    Manager  Degree 
Programmer   ECN Type ECN Code RFQ Type

Dan |  McGre |  21  |  pbhal    |   true     |  BA   
|    false        |        1      |    5  |     9
---    | --- | --- | --- | --- |--- | --- |    2    | 
  6  |   10

---    | --- | --- | --- | --- |--- | --- |    3   |  
 7  |   11

---    | --- | --- | --- | --- |--- | --- |    4  |   
8  |   12

 etc etc.

I appreciate if someone could please give some
pointers?

Thanks in Advance 

Prashant

I have written this type of xsl.

<xsl:template match="my:Person">

<tr>

<xsl:for-each select="*">

<td><xsl:value-of select="."/></td>

</xsl:for-each>


<!-- <xsl:for-each select="@*">

<td><xsl:value-of select="."/></td>

</xsl:for-each> -->

<!--<xsl:apply-templates select="//my:Attribute" />-->

<xsl:variable name="ecncode"
select="my:Attribute[@Name='ECNCode']/my:List/my:ListMember[3]"
/>


<xsl:apply-templates

select="my:Attribute[@Name='ECNType']"/>

<!-- <xsl:apply-templates

select="my:Attribute[@Name='ECNCode']"/>-->

</tr>

</xsl:template>

<xsl:template match="my:Attribute">

<td>

<xsl:for-each select="my:List/my:ListMember">

<td><xsl:value-of select="."/></td>

</xsl:for-each> 

</td>

</xsl:template>

<xsl:template match="my:Attribute[@Name='ECNType']">

<xsl:for-each select="my:List/my:ListMember">

<td>

<tr><td>---</td>

<td>---</td>

<td>---</td>

<td>---</td>

<td>---</td>

<td>---</td>

<td>---</td>

<td><xsl:value-of select="." /></td>

<Dont know what to do here?></Dont>

<!--<td><xsl:call-template name="ECNCode" >

<xsl:with-param name="count" select="position()" />

</xsl:call-template>-->


</td>

</tr>

</td> 

</xsl:for-each> 

</xsl:template>

<xsl:template name="ECNCode">

<xsl:apply-templates 

select="my:Attribute[@Name='ECNCode']"/>

</xsl:template>

<xsl:template match="my:Attribute[@Name='ECNCode']">

<xsl:value-of select="$count"/>

<xsl:value-of select="my:List/my:ListMember[$count]"
/>

<!-- <xsl:for-each select="my:List/my:ListMember">

<td><xsl:value-of select=""/>

</xsl:for-each> -->

</xsl:template>

 

Thanks in advance.

Prashant



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

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.