Click here to Skip to main content
15,897,371 members
Home / Discussions / XML / XSL
   

XML / XSL

 
GeneralRe: Empty value is passed while reading value from an XML node Pin
led mike30-Jun-09 4:42
led mike30-Jun-09 4:42 
GeneralRe: Empty value is passed while reading value from an XML node Pin
Stuart Dootson30-Jun-09 4:44
professionalStuart Dootson30-Jun-09 4:44 
GeneralRe: Empty value is passed while reading value from an XML node Pin
Mahesh.J30-Jun-09 19:49
Mahesh.J30-Jun-09 19:49 
QuestionForEach reading only the last node only Pin
albchinsh24-Jun-09 16:17
albchinsh24-Jun-09 16:17 
AnswerRe: ForEach reading only the last node only Pin
Adam Maras24-Jun-09 16:40
Adam Maras24-Jun-09 16:40 
GeneralRe: ForEach reading only the last node only Pin
albchinsh24-Jun-09 18:40
albchinsh24-Jun-09 18:40 
QuestionNested foreach loop Urgent Pin
bbm2k321-Jun-09 6:01
bbm2k321-Jun-09 6:01 
AnswerRe: Nested foreach loop Urgent Pin
Stuart Dootson21-Jun-09 14:03
professionalStuart Dootson21-Jun-09 14:03 
This XSLT

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <xsl:template match="/">
    <table>
      <xsl:for-each select="Compare/columnNames/column">
        <tr>
          <xsl:variable name="ColName" select="na"></xsl:variable>
          <td>
            <xsl:value-of select="na"/>
          </td>
          <xsl:for-each select="///Compare/Hotels/Hotel">
            <td>
              <xsl:value-of select="./*[name()=$ColName]"/>
            </td>
          </xsl:for-each>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>
</xsl:stylesheet>


produces this HTML fragment - is that what you were after?

<?xml version="1.0"?>
<table>
  <tr>
    <td>Name</td>
    <td>Hotel Mount View</td>
    <td>Hotel Mayur</td>
  </tr>
  <tr>
    <td>Address</td>
    <td>123</td>
    <td>Adress1</td>
  </tr>
  <tr>
    <td>Phone</td>
    <td>1234</td>
    <td>12345678</td>
  </tr>
</table>


Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p

QuestionSkip root elements for sub classes when serializing complex object Pin
Member 183766120-Jun-09 2:23
Member 183766120-Jun-09 2:23 
AnswerRe: Skip root elements for sub classes when serializing complex object Pin
Stuart Dootson20-Jun-09 14:43
professionalStuart Dootson20-Jun-09 14:43 
Questionxml menubar Pin
paypony18-Jun-09 20:29
paypony18-Jun-09 20:29 
AnswerRe: xml menubar Pin
Stuart Dootson18-Jun-09 22:12
professionalStuart Dootson18-Jun-09 22:12 
AnswerRe: xml menubar Pin
led mike19-Jun-09 5:15
led mike19-Jun-09 5:15 
GeneralRe: xml menubar Pin
Stuart Dootson19-Jun-09 12:47
professionalStuart Dootson19-Jun-09 12:47 
QuestionUse same objects to access DB and WebService Pin
the_jat18-Jun-09 3:57
the_jat18-Jun-09 3:57 
AnswerCross Posted Pin
led mike18-Jun-09 5:19
led mike18-Jun-09 5:19 
QuestionDetect Invalid sequence of tag in XML document using schema. Pin
tprakash17-Jun-09 21:35
tprakash17-Jun-09 21:35 
AnswerRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson18-Jun-09 0:15
professionalStuart Dootson18-Jun-09 0:15 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash18-Jun-09 18:10
tprakash18-Jun-09 18:10 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash14-Jul-09 2:18
tprakash14-Jul-09 2:18 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson14-Jul-09 2:25
professionalStuart Dootson14-Jul-09 2:25 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash14-Jul-09 22:54
tprakash14-Jul-09 22:54 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
Stuart Dootson15-Jul-09 0:27
professionalStuart Dootson15-Jul-09 0:27 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash15-Jul-09 21:35
tprakash15-Jul-09 21:35 
GeneralRe: Detect Invalid sequence of tag in XML document using schema. Pin
tprakash14-Jul-09 23:13
tprakash14-Jul-09 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.