Stylesheet assistance

Subject: Stylesheet assistance
From: Daniel Pitti <dvp4c@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 25 Jul 2000 12:06:56 -0400
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.

<html>
        <body>
                <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>
        </body>
</html>

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

<html>
        <body>
                <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>
        </body>
</html>
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