This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
XSL question
- From: "Manoj Jha" <manoj_k_jha at hotmail dot com>
- To: XSL-List at lists dot mulberrytech dot com
- Date: Mon, 25 Mar 2002 21:32:27
- Subject: [xsl] XSL question
- Reply-to: xsl-list at lists dot mulberrytech dot com
Hi,
I need the solve the following problem using XSL. Could some guru help me
out ?
Below is a sample XML that I want to transform:
<?xml version="1.0"?>
<DocumentRequest>
<Director>
<DocumentName>UnderwritingAnalysisPage1</DocumentName>
<DeliveryMedium>browser</DeliveryMedium>
<ApplicationId>15</ApplicationId>
<PostPay>no</PostPay>
</Director>
<DocumentDetails>
<BorrowerName>WALZER, CLIFFORD S</BorrowerName>
<LoanStatus>APPROVED</LoanStatus>
.
.
<ConditionText1>PRIOR TO APPROVAL CONDITIONS - UGSI TO
REVIEW:</ConditionText1>
<ConditionText2> </ConditionText2>
<ConditionText3>PRIOR TO DOC CONDITIONS - UGSI TO
REVIEW:</ConditionText3>
<ConditionText4> </ConditionText4>
<ConditionText5>PRIOR TO CLOSING CONDITIONS - UGSI TO
REVIEW:</ConditionText5>
<ConditionText6>03/14/2002 _____ THANK YOU FOR CHOOSING UNITED GUARANTY.
PLEASE INCLUDE A COPY OF </ConditionText6>
<ConditionText7> THIS</ConditionText7>
.
.
<ConditionText15>CLOSING CONDITIONS:</ConditionText15>
<ConditionText16> X FINAL SIGNED T-I-L</ConditionText16>
<ConditionText17> X FILE MUST CLOSE AS A 30 YEAR
RATE/TERM REFINANCE</ConditionText17>
.
.
<ConditionText44> </ConditionText44>
</DocumentDetails>
</DocumentRequest>
The tag value "CLOSING CONDITIONS:" can appear as value of any of the
ConditionText tags, but after the "PRIOR CONDITIONS".
The XSL stylesheet should locate the "CLOSING CONDITIONS:" value, and insert
3 new predefined fixed ConditionText nodes after
that node. All the remaining ConditionText nodes will show this change in
the result tree by having their count incremented as
shown in the transformed XML below:
<?xml version="1.0"?>
<DocumentRequest>
<Director>
<DocumentName>UnderwritingAnalysisPage1</DocumentName>
<DeliveryMedium>browser</DeliveryMedium>
<ApplicationId>15</ApplicationId>
<PostPay>no</PostPay>
</Director>
<DocumentDetails>
<BorrowerName>WALZER, CLIFFORD S</BorrowerName>
<LoanStatus>APPROVED</LoanStatus>
.
.
<ConditionText1>PRIOR TO APPROVAL CONDITIONS - UGSI TO
REVIEW:</ConditionText1>
<ConditionText2> </ConditionText2>
<ConditionText3>PRIOR TO DOC CONDITIONS - UGSI TO
REVIEW:</ConditionText3>
<ConditionText4> </ConditionText4>
<ConditionText5>PRIOR TO CLOSING CONDITIONS - UGSI TO
REVIEW:</ConditionText5>
<ConditionText6>03/14/2002 _____ THANK YOU FOR CHOOSING UNITED GUARANTY.
PLEASE INCLUDE A COPY OF </ConditionText6>
<ConditionText7> THIS</ConditionText7>
.
.
<ConditionText15>CLOSING CONDITIONS:</ConditionText15>
<ConditionText16> X This is Standard Condition
1</ConditionText16> <!-- These 3 conditions get inserted -->
<ConditionText17> X This is Standard Condition
2</ConditionText17>
<ConditionText18> X This is Standard Condition
3</ConditionText18>
<ConditionText19> X FINAL SIGNED T-I-L</ConditionText16>
<!-- ConditionText16 now becomes Condition19, and so on; the
value for the node remains the same -->
<ConditionText20> X FILE MUST CLOSE AS A 30 YEAR
RATE/TERM REFINANCE</ConditionText17>
.
.
<ConditionText47> </ConditionText44>
</DocumentDetails>
</DocumentRequest>
_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail.
http://www.hotmail.com
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list