[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Identity Transformation of XML for web display

Subject: Re: Identity Transformation of XML for web display
From: "Karl Stubsjoen" <kstubs@xxxxxxxxx>
Date: Sat, 18 Mar 2006 17:58:02 -0700
xsl wbttransformforhtmldisplay
Here is what I have so far:

<xsl:template match="node()" mode="wbtTransformForHTMLDisplay">
<div>
 <xsl:text>&gt;</xsl:text>
  <xsl:value-of select="name(.)"/>
    <xsl:apply-templates select="@*"/>
  <xsl:text>&lt;</xsl:text>
    <xsl:value-of select="."/>
  <xsl:text>&gt;/</xsl:text>
  <xsl:value-of select="name(.)"/>
  <xsl:text>&lt;</xsl:text>
</div>
</xsl:template>

<xsl:template match="@*" mode="wbtTransformForHTMLDisplay">
  <xsl:value-of select="concat(name(.), '=',."/>
</xsl:template>


On 3/18/06, Karl Stubsjoen <kstubs@xxxxxxxxx> wrote:
> Hello,
>
> I'd like to create an identity tranformation that replaces "<" this
> and ">" this to "&lgt;" and "&glt" for display of the XML document on
> an HTML page.  I can handle this part, but would like help with the
> spacing of the elements as they appear hierachely.  So example, how to
> space:
>
> into
>
> <A>
>   <B>
>       <C/>
>   </B>
> </A>
>
> you have to be very intuitive as to knowing at which depth you are in
> your transformation to style this something like:
>
>
> <div style="indent_3">&glt;C&glt;</div>
>
> where style indent_3 is a margin of 20px for example.
>
> Any help would be appreciated.
>
> Karl..

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.