xsl-list
[Top] [All Lists]

Indentation question

2005-09-02 00:06:47
Hello. Sometimes when I deal with XSLT, if I use this indent method:

<xsl:output method="xml" indent="no" />

Then I obtain all the results in one line, no EOL's.

But I have found a case where this is not true, why?

XML:

<?xml version="1.0"?>
<PreLogin xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <Errors />
  <LoginName>fernando_martinez</LoginName>
</PreLogin>

XSLT:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
  <xsl:output method="xml" indent="no" />
  <xsl:template match="/*">
    <page>
      <title>t</title>
      <head />
      <content>
        <h2>
          <xsl:choose>
            <xsl:when test="LoginName">
              1
            </xsl:when>
            <xsl:when test="AccessMode = 'admin'">
              2
            </xsl:when>
            <xsl:otherwise>
              3
            </xsl:otherwise>
          </xsl:choose>
        </h2>
      </content>
    </page>
  </xsl:template>
</xsl:stylesheet>

RESULT:
<page><title>t</title><head /><content><h2>
              1
            </h2></content></page>

Any ideas? Thanks in advance.

Regards,

  Andrew

--

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>