[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: "Nathan Young -X \(natyoung - Artizen at Cisco\)" <natyoung@xxxxxxxxx>
Date: Mon, 20 Mar 2006 16:36:09 -0800
display xml in a div
Hi.

You have to decide if you want margins that nest or not, which goes
along with weather you want to preserve hierarchy in the output or not.

As outline in this thread so far, it's been implied that you would
flatten things out:

<style>
.indent_1 {margin-left:10px;}
.indent_2 {margin-left:20px;}
.indent_3 {margin-left:30px;}
</style>
<div class="indent_1">&lt;A&gt;</div>
<div class="indent_2">&lt;B&gt;</div>
<div class="indent_3">&lt;C&gt;</div>
<div class="indent_2">&lt;/B&gt;</div>
<div class="indent_1">&lt;/A&gt;</div>

You could also use additive margins and nesting like so:

<style>
div {margin-left:10px;}
</style>
<div>
	&lt;A&gt;
	<div>
		&lt;B&gt;
		<div>
			&lt;C&gt;
		</div>
		&lt;/B&gt;
	</div>
	&lt;/A&gt;
</div>



----------------->Nathan


.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:||:._.:
||:.

Nathan Young
CDC Site Design & Development->Interface Development Team
A: ncy1717
E: natyoung@xxxxxxxxx

> -----Original Message-----
> From: Wendell Piez [mailto:wapiez@xxxxxxxxxxxxxxxx]
> Sent: Monday, March 20, 2006 8:57 AM
> To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
> Subject: Re:  Identity Transformation of XML for web display
>
> Karl,
>
> This is not hard to do, either with literal spaces (non-breaking
> spaces) or with CSS when displaying HTML.
>
> You looks like you're using CSS. If you're using a @class layer, it
> looks like the class of any particular div will be done like this:
>
> <div class="indent_{count(ancestor-or-self::*)}">...</div>
>
> which would result in class="indent_1" for an outermost div,
> "indent_2" for a div a level down, etc.
>
> You could do the same thing with style="{count(ancestor::*) * 10}px">
> and get your indents hard-coded that way: this would result in 0px,
> 10px, 20px etc from outermost in.
>
> I hope that helps.
>
> Cheers,
> Wendell
>
> At 07:49 PM 3/18/2006, you 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.
>
>
> ======================================================================
> Wendell Piez                            mailto:wapiez@xxxxxxxxxxxxxxxx
> Mulberry Technologies, Inc.                http://www.mulberrytech.com
> 17 West Jefferson Street                    Direct Phone: 301/315-9635
> Suite 207                                          Phone: 301/315-9631
> Rockville, MD  20850                                 Fax: 301/315-8285
> ----------------------------------------------------------------------
>    Mulberry Technologies: A Consultancy Specializing in SGML and XML
> ======================================================================

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.