Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem about XSLT.
i have a xml file :
XML
<?xml-stylesheet type="text/xsl" href="XSLTFile1.xslt"?>
<otx xmlns="http://iso.org/OTX/1.0.0" xmlns:i18n="http://iso.org/OTX/1.0.0/i18n" xmlns:diag="http://iso.org/OTX/1.0.0/DiagCom" xmlns:measure="http://iso.org/OTX/1.0.0/Measure" xmlns:string="http://iso.org/OTX/1.0.0/StringUtil" xmlns:fileXml="http://vwag.de/OTX/1.0.0/XmlFile" xmlns:log="http://iso.org/OTX/1.0.0/Logging" xmlns:file="http://vwag.de/OTX/1.0.0/File" xmlns:dataPlus="http://iso.org/OTX/1.0.0/DiagDataBrowsingPlus" xmlns:event="http://iso.org/OTX/1.0.0/Event" xmlns:quant="http://iso.org/OTX/1.0.0/Quantities" xmlns:hmi="http://iso.org/OTX/1.0.0/HMI" xmlns:math="http://iso.org/OTX/1.0.0/Math" xmlns:flash="http://iso.org/OTX/1.0.0/Flash" xmlns:data="http://iso.org/OTX/1.0.0/DiagDataBrowsing" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dt="http://iso.org/OTX/1.0.0/DateTime" xmlns:eventPlus="http://iso.org/OTX/1.0.0/EventPlus" xmlns:corePlus="http://iso.org/OTX/1.0.0/CorePlus" xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:job="http://iso.org/OTX/1.0.0/Job" id="id_e895af47737740b1b0aca75a4f43dd86" name="NewDocument1" package="NewOtxProject1Package1" version="1.0.0.0" timestamp="2014-04-03T15:11:12.3634145+07:00">
  <procedures>
    <procedure id="id_25f45459817744f083d360ff75c0ea5b" name="main" visibility="PUBLIC">
    </procedure>
  </procedures>
</otx>


and this is my XSLT
XML
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://iso.org/OTX/1.0.0"
    xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl"
>
  <xsl:output method="html" indent="yes"/>

  <!--<xsl:template match="@* | node()">
        <xsl:copy>
            <xsl:apply-templates select="@* | node()"/>
        </xsl:copy>-->

  <xsl:template match="/">
    <html lang="en">
      <body>
        <form class="form-horizontal" role="form">
          <div class="form-group">
            <div class="col-sm-10">
              <label>Procedures:</label>
              <div class="table-responsive">
                <table>
                  <xsl:for-each select="otx/procedures/procedure">
                    <tr>
                      <td>
                        <xsl:value-of select="@name"/>
                      </td>
                    </tr>
                  </xsl:for-each>
                </table>
              </div>
            </div>
          </div>
        </form>
      </body>
    </html>

  </xsl:template>
</xsl:stylesheet>


When i clicked on xml file, it cannot get data when showing on browser.
please help me, what is wrong in the XSLT?
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900