How about something like-a-this as well: http://www.c2.com/cgi/wiki?WikiWikiWeb
----- Original Message -----
Sent: Tuesday, October 17, 2000 2:57 AM
Subject: RE: displaying xml

Or how about a faq-o-matic? Seems ideal for this kind of thing.
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Porfiriev Sergey
Sent: Monday, October 16, 2000 8:33 PM
To: Orion-Interest
Subject: Re: displaying xml

To Magnus & Karl Avedal:
 
it will be good idea to open "users contribution" topic at www.OrionServer.com
( like orionsupport was). and as result traffic in orion-interest will be decreased :)
 
----- Original Message -----
Sent: Monday, October 16, 2000 6:44 PM
Subject: Re: displaying xml

Hi Troy, thanks, but I've already tried.  the <pre> </pre> tags do preserve the indentation of the XML, but do not allow for the displaying of tags for some reason.
 
1) use <xmp> </xmp> tags - pre can;'t help. 
 
2) use this xsl for XML parsing - ( i use it with Salaman's Saxon XSLT engine, but it will work under Orion default XSLT (xerces))
    it will display your XML as HTML with XML reformating and coloring
 
 
 
 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="windows-1251" indent="yes"/>
 
<!-- Generic stylesheet for viewing XML -->
<!-- This stylesheet has been modified to use modes instead of nested templates. -->
<!-- Last Updated by Parf: moved to lotus xsl, main tag fix -->
 
  <xsl:template match="/">
   <HTML>
    <xsl:apply-templates/>  
   </HTML>
  </xsl:template>
 
  <xsl:template match="node()">
   <xsl:if test="name()!='xml-stylesheet'">
    <b><big><xsl:text>&lt;</xsl:text><xsl:value-of select="name()"/><xsl:text>&gt;</xsl:text></big></b><br/>
    <DIV STYLE="font-family:Courier; font-size:10pt; margin-bottom:0em">
      <xsl:apply-templates mode="inside"/>
    </DIV>
    <b><big><xsl:text>&lt;/</xsl:text><xsl:value-of select="name()"/><xsl:text>&gt;</xsl:text></big></b>
   </xsl:if>
  </xsl:template>
 
  <xsl:template match="*" mode="inside">
    <DIV STYLE="margin-left:1em">
      <SPAN STYLE="color:blue">
        <xsl:text>&lt;</xsl:text>
        <b><xsl:value-of select="name()"/></b>
        <xsl:for-each select="@*">
          <xsl:call-template name="attribute"/>
        </xsl:for-each>
        <xsl:choose>
          <xsl:when test="self::node()">
            <xsl:text>&gt;</xsl:text>
            <xsl:apply-templates mode="inside"/>
            <xsl:text>&lt;/</xsl:text>
            <xsl:value-of select="name()"/>
            <xsl:text>&gt;</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>/&gt;</xsl:text>
          </xsl:otherwise>
        </xsl:choose> 
      </SPAN>
    </DIV>
  </xsl:template>
 
  <xsl:template name="attribute">
    <SPAN STYLE="color:navy">
      <xsl:text> </xsl:text>
          <xsl:value-of select="name()"/>
      <xsl:text>="</xsl:text>
      <SPAN STYLE="color:black">
        <xsl:value-of select="."/>
      </SPAN>
      <xsl:text>"</xsl:text>
    </SPAN>
  </xsl:template>
 
  <xsl:template match="comment()" mode="inside">
    <SPAN STYLE="color:orange">
      <xsl:text>&lt;!--</xsl:text><xsl:value-of select="."/><xsl:text>--&gt;</xsl:text>
    </SPAN>
  </xsl:template>
 
  <xsl:template match="processing-instruction()" mode="inside">
    <DIV STYLE="margin-left:1em; color:maroon">
      <xsl:text>&lt;?</xsl:text>
      <xsl:value-of select="name"/>
      <xsl:text> </xsl:text>
      <xsl:value-of select="."/>
      <xsl:text>?&gt;</xsl:text>
    </DIV>
  </xsl:template>
 
  <xsl:template match="text()" mode="inside">
    <SPAN STYLE="color:green">
      <xsl:value-of select="."/>
    </SPAN>
  </xsl:template>
 
</xsl:stylesheet>
 
----- Original Message -----
Sent: Monday, October 16, 2000 5:09 PM
Subject: Re: displaying xml

Perhaps enclosing the xml in <pre> </pre> will work.

Troy Echols

Derek Akers wrote:

 Hi all...  I am trying to display the contents of an XML file to the screen, embedded inside a JSP page.  That is, I want to include a header and footer on the page (for navigation purposes), with the XML in the middle.  I want the text to be viewable literally (tags & all), but I have been unable to find a solution... I thought maybe the contentType attribute of the <%@ page %> directive might do it, but it seems not. Does anyone know of a way to do this?  Derek Akers Internet Application Developer
Eldan Software, Toronto
(416) 341-0070
www.eldan.com

Reply via email to