xslt help - my transform is not rendering correctly

Posted by Hcabnettek on Stack Overflow See other posts from Stack Overflow or by Hcabnettek
Published on 2010-05-28T16:47:10Z Indexed on 2010/05/28 16:52 UTC
Read the original article Hit count: 368

Filed under:
|
|
|

Hi All, I'm trying to apply an xlst transformation using the following file. This is very basic, but I wanted to build off of this when I get it working correctly.

 <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:msxsl="urn:schemas-microsoft-com:xslt" exclude-result-prefixes="msxsl">
<xsl:template match="/">
  <div>
  <h2>Station Inventory</h2>
  <hr/>
  <xsl:apply-templates/>
  </div>
</xsl:template>


Here is some xml I'm using for the source.

 <StationInventoryList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"       xmlns="http://www.dummy-tmdd-address">
  <StationInventory>
   <station-id>9940</station-id>
   <station-name>Zone 9940-SEB</station-name>
   <station-travel-direction>SEB</station-travel-direction>
   <detector-list>
  <detector>
    <detector-id>2910</detector-id>
    <detector-name>1999 West Smith Exit SEB</detector-name>
  </detector>
  <detector>
    <detector-id>9205</detector-id>
    <detector-name>CR-155 Exit SEB</detector-name>
  </detector>
  <detector>
    <detector-id>9710</detector-id>
    <detector-name>Pt of View SEB</detector-name>
  </detector>
  </detector-list>
  </StationInventory>
</StationInventoryList>

Any ideas what I'm doing wrong? The simple intent here is to make a list of station, then make a list of detectors at a station. This is a small piece of the XML. It would have multiple StationInventory elements.

I'm using the data as the source for an asp:xml control and the xslt file as the transformsource.

        var service = new InternalService();
        var result = service.StationInventory();

        invXml.DocumentContent = result;
        invXml.TransformSource = "StationInventory.xslt";
        invXml.DataBind();

Any tips are of course appreciated. Have a terrific weekend.

Cheers, ~ck

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET