Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


simple xsl question

From: vanSkier <rod_Kane@-------.--->
To: NULL
Date: 7/20/2008 1:46:00 AM
Hi,

I'm learning xsl and am encountering an unexpected  result with the
xml / xsl below

The xsl result includes text from the printsettings nodes:  "1none",
and since this was not included in the select attribute.

It's strange that the unspecified node is the first node of the
document.  I've simplified the xml document to remove other nodes, but
when those nodes were present it was still only the first node that
had it's text printed out.

If you have any idea why the text of the printsettings nodes is being
printed I'd appreciate hearing the explanation.

I'm using Microsofts XMLNotepad to view the output

Thank you,

Rod


<?xml version="1.0" encoding="utf-8"?>
<template>

  <printsettings>
    <orientation>1</orientation>
    <header>none</header>
  </printsettings>

  <columns>

	<colrange name="C1">
      <coldimspecs>
        <coldimspec >
          <memberspecs>
            <memberspec />
          </memberspecs>
        </coldimspec>
        <coldimspec dimensionname="Scenario" >
          <memberspecs>
            <memberspec memberkey="" />
          </memberspecs>
        </coldimspec>
      </coldimspecs>
    </colrange>

    <colrange name="C2">
      <coldimspecs>
        <coldimspec >
          <memberspecs>
            <memberspec />
          </memberspecs>
        </coldimspec>
        <coldimspec dimensionname="Scenario" >
          <memberspecs>
            <memberspec memberkey="" />
          </memberspecs>
        </coldimspec>
      </coldimspecs>
    </colrange>

  </columns>

</template>






<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">

<xsl:template match="/">
<HTML>
<BODY>
    <xsl:apply-templates/>
</BODY>
</HTML>
</xsl:template>


<xsl:template match="columns/colrange">
<TABLE BORDER="1"  width="40%" >
<TR>

	<xsl:value-of select="local-name()"/>
	<xsl:text>:  </xsl:text>		<xsl:value-of select="@name"/>
	<xsl:text>   </xsl:text>		<xsl:value-of select="@description"/>

        <xsl:for-each select="*/*/*/*">
          <TD>
              <xsl:value-of select="local-name()"/>
          </TD>
        </xsl:for-each>

</TR>

</TABLE>

</xsl:template>



</xsl:stylesheet>







transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent