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

XSL assistance

Subject: XSL assistance
From: Daniel Pitti <dvp4c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 25 Jul 2000 16:03:31 -0400
xsl p style margin left
[I sent this request earlier and my mail program stripped the html encoding. Here it is again, with the html encoding intact.]

Any suggestions on how do do the following?

Given the following DTD:

<!DOCTYPE test

[

<!ELEMENT test  (a1)+ >
<!ELEMENT a1    (b?, p, a2*) >
<!ELEMENT a2    (b?, p, a3*) >
<!ELEMENT a3    (b?, p, a4*) >
<!ELEMENT a4    (b?, p, a5*) >
<!ELEMENT a5    (b?, p, a6*) >
<!ELEMENT a6    (b?, p) >
<!ELEMENT b     EMPTY >
<!ELEMENT p     (#PCDATA) >
]>

And example instances 1 and 2:

Instance 1

<test>
	<a1>
		<p>Text of a1</p>
		<a2>
			<b/>
			<p>Text of a2</p>
			<a3>
				<p>Text of a3</p>
				<a4>
					<p>Text of a4</p>
					<a5>
						<p>Text of a5</p>
						<a6>
							<p>Text of a6</p>
						</a6>
					</a5>
				</a4>
			</a3>
		</a2>
	</a1>
</test>

Instance 2

<test>
	<a1>
		<p>Text of a1</p>
		<a2>
			<p>Text of a2</p>
			<a3>
				<b/>
				<p>Text of a3</p>
				<a4>
					<p>Text of a4</p>
					<a5>
						<p>Text of a5</p>
						<a6>
							<p>Text of a6</p>
						</a6>
					</a5>
				</a4>
			</a3>
		</a2>
	</a1>
</test>

I want each <p> in <a1>, <a2>, etc. to appear in an html <p> AND I want the indention for each <p> to be relative to where <b> occurred. For example, I want the following html output, where <b> occurs in <a2> in Instance 1.


<p>Text of a1</p> <p>Text of a2</p> <p style='margin-left: 12px'>Text of a3</p> <p style='margin-left: 24px'>Text of a4</p> <p style='margin-left: 36px'>Text of a5</p> <p style='margin-left: 48px'>Text of a6</p>


And the following where <b> occurs in <a3> for Instance 2.



<p>Text of a1</p> <p>Text of a2</p> <p>Text of a3</p> <p style='margin-left: 12px'>Text of a4</p> <p style='margin-left: 24px'>Text of a5</p> <p style='margin-left: 36px'>Text of a6</p>



Daniel V. Pitti 	Project Director
Institute for Advanced Technology in the Humanities
Alderman Library	University of Virginia	Charlottesville, Virginia 22903
Phone: 804 924-6594	Fax: 804 982-2363	Email: dpitti@xxxxxxxxxxxx
http://jefferson.village.virginia.edu


XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list



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.