Help | Site Map
Connecting Tech Pros Worldwide
Reply
 
LinkBack Thread Tools
  #1  
Old October 3rd, 2008, 01:03 PM
Newbie
 
Join Date: Oct 2008
Posts: 2
Default Copy XML and Change Element Value using XSLT

hi,

I have a xml in which I want to replace the element(s) value with XSLT

Xml message

Expand|Select|Wrap|Line Numbers
  1. <Message>
  2. <case>
  3. <party1>
  4. <!--  there are other elements -->
  5. <notes id="1">abcd</notes>
  6. <notes id="2">abcd</notes>
  7. <notes id="3">abcd</notes>
  8.    -----
  9.  
  10. <notes id=n>some text</notes>
  11. </party1>
  12.  
  13. <party2>
  14. <!--  there are other elements -->
  15. <notes id="1">abcd</notes>
  16. <notes id="2">abcd</notes>
  17. <notes id="3">abcd</notes>
  18.    -----
  19.  
  20. <notes id=n>some text</notes>
  21. </party2>
  22.  
  23. <client1>
  24.  
  25. <!--  there are other elements -->
  26. <notes id="1">abcd</notes>
  27. <notes id="2">some text</notes>
  28. <notes id="3">some text</notes>
  29.    -----
  30.  
  31. <notes id="n">some text</notes>
  32.  
  33. </client1>
  34.  
  35. <client2>
  36.  
  37. <!--  there are other elements -->
  38. <notes id="1">some text</notes>
  39. <notes id="2">some text</notes>
  40. <notes id="3">some text</notes>
  41.    -----
  42.  
  43. <notes id="n">some text</notes>
  44.  
  45. </client2>
  46.  
  47.  
  48. </case>
  49. </Message>
From the above xml I want to copy all the elements to another xml but, I want to modify the values <notes> element to some other value.

I have managed to construct a XSL like this.

XSL :
Expand|Select|Wrap|Line Numbers
  1. <?xml version='1.0' encoding='ISO-8859-1'?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
  3. <xsl:output method="xml" indent="yes"/>
  4. <xsl:strip-space elements="*"/>
  5. <xsl:key name="nvalue" match="notes" use="text()"/>
  6.  
  7. <xsl:template match="node()">
  8.         <xsl:copy>
  9.                 <xsl:copy-of select="@*"/>
  10.          <xsl:apply-templates select="node()"/>
  11.         </xsl:copy>
  12. </xsl:template>
  13.  
  14. <xsl:apply-templates select="notes"/>
  15.  
  16. <xsl:template match="notes">
  17. <notes>replace notes</notes>
  18. </xsl:template>
  19.  
  20. </xsl:stylesheet>
please help me with the XSL

Many thanks in advance

Last edited by mskichu; October 3rd, 2008 at 01:51 PM. Reason: correction to my XSL
Reply
  #2  
Old October 3rd, 2008, 01:35 PM
Dormilich's Avatar
Expert
 
Join Date: Aug 2008
Location: Leipzig, Germany
Age: 31
Posts: 675
Default

What's the problem? It's working as you intend (...once you correct the xml (it's not well-formed)—put the attribute values in quotes)

regards
Reply
  #3  
Old October 3rd, 2008, 03:09 PM
Moderator
 
Join Date: Mar 2006
Posts: 898
Default

Well, from your code you'd be missing the id attributes on notes nodes. Is that the problem?

Could change your notes template accordingly.
Expand|Select|Wrap|Line Numbers
  1. <xsl:template match="notes"> 
  2.         <xsl:copy> 
  3.                 <xsl:copy-of select="@*"/> 
  4.                 <xsl:text>replace notes</xsl:text>
  5.         </xsl:copy> 
  6. </xsl:template> 
  7.  
<xsl:copy-of select="@*"/> is the line that would copy the id attributes.
Reply
  #4  
Old October 4th, 2008, 11:00 AM
Newbie
 
Join Date: Oct 2008
Posts: 2
Default

Thank you very much for point it out !! Yes I'm missing the @ attribute template. I have corrected it. like this.



Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.     <xsl:template match="*">
  4.         <xsl:copy>
  5.             <xsl:apply-templates select="@*|*|text()"/>
  6.         </xsl:copy>
  7.     </xsl:template>
  8.     <xsl:template match="notes">
  9.         <notes><xsl:apply-templates select="@*"/>replaced Value</notes>
  10.     </xsl:template>
  11.  
  12.     <xsl:template match="@*|text()">
  13.         <xsl:copy/>
  14.     </xsl:template>
  15.  
  16. </xsl:stylesheet>
But, I'm getting another issue it not working on the xml on which I intend to work
please let me know if changes for my XSL on below XML


Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0"?>
  2. <message xmlns="somexsd">
  3.   <control sequence_id="1">
  4.     <msg_type>kFSM</msg_type>
  5.     <msg_version>1.1.1</msg_version>
  6.   </control>
  7.   <case id="TEST" type="Personal">
  8.     <party id="Client" sequence_number="1" type="Client">
  9.       <title>Col</title>
  10.       <forename>Sdfasd</forename>
  11.       <surname>jsdfgsdf</surname>
  12.       <known_as>Col Sdfasd Jsdfgsdf</known_as>
  13.       <full_name>Col Sdfasd jsdfgsdf</full_name>
  14.       <notes type="Personal" />
  15.       <notes type="Contact" />
  16.       <notes type="NDI changes" />
  17.       <notes type="Income Summary" />
  18.       <notes type="Earned income" />
  19.       <notes type="Other income" />
  20.       <notes type="Employee benefits" />
  21.       <contact>
  22.         <address>
  23.           <house_name_number />
  24.           <line_1 />
  25.           <line_2 />
  26.           <line_3 />
  27.           <line_4 />
  28.           <postcode />
  29.         </address>
  30.         <telephone type="daytime">
  31.           <number />
  32.         </telephone>
  33.         <telephone type="evening">
  34.           <number />
  35.         </telephone>
  36.         <telephone type="mobile">
  37.           <number />
  38.         </telephone>
  39.         <email>
  40.           <address />
  41.         </email>
  42.         <best_time />
  43.       </contact>
  44.       <date_of_birth />
  45.       <nationality>GBR</nationality>
  46.       <national_insurance_number />
  47.       <health>
  48.         <notes type="Health" />
  49.       </health>
  50.       <relationship_to />
  51.       <residential_status />
  52.       <highest_tax_rate />
  53.       <employment sequence_number="1">
  54.         <earnings type="Basic">
  55.           <frequency>Annually</frequency>
  56.         </earnings>
  57.         <earnings type="Bonus">
  58.           <frequency>Annually</frequency>
  59.         </earnings>
  60.         <earnings type="Payslip">
  61.           <frequency>Monthly</frequency>
  62.         </earnings>
  63.         <start_date />
  64.       </employment>
  65.       <employment sequence_number="2">
  66.         <earnings type="Basic">
  67.           <frequency>Annually</frequency>
  68.         </earnings>
  69.         <earnings type="Bonus">
  70.           <frequency>Annually</frequency>
  71.         </earnings>
  72.         <earnings type="Total">
  73.           <frequency>Monthly</frequency>
  74.         </earnings>
  75.       </employment>
  76.       <employment sequence_number="3">
  77.         <benefit type="Death in service" />
  78.         <benefit type="Dependants pension" />
  79.         <benefit type="Sickness period 1">
  80.           <duration />
  81.           <earnings_related />
  82.         </benefit>
  83.         <benefit type="Sickness period 2">
  84.           <duration />
  85.           <earnings_related />
  86.         </benefit>
  87.       </employment>
  88.       <income sequence_number="1" type="Agreed investment and asset">
  89.         <amount_net />
  90.         <frequency>Monthly</frequency>
  91.       </income>
  92.       <income sequence_number="9" type="Other Total" />
  93.       <income type="State benefits">
  94.         <amount_net />
  95.         <frequency>Monthly</frequency>
  96.       </income>
  97.       <income sequence_number="1" type="Earned">
  98.         <amount_gross />
  99.         <frequency>Annually</frequency>
  100.       </income>
  101.       <income sequence_number="1" type="Earned and Other">
  102.         <amount_net>0</amount_net>
  103.         <frequency>Monthly</frequency>
  104.       </income>
  105.       <income sequence_number="1" type="Other">
  106.         <frequency>Monthly</frequency>
  107.         <income_ind />
  108.       </income>
  109.       <income sequence_number="2" type="Other">
  110.         <frequency>Monthly</frequency>
  111.         <income_ind />
  112.       </income>
  113.       <income sequence_number="3" type="Other">
  114.         <frequency>Monthly</frequency>
  115.         <income_ind />
  116.       </income>
  117.       <income sequence_number="4" type="Other">
  118.         <frequency>Monthly</frequency>
  119.         <income_ind />
  120.       </income>
  121.       <income sequence_number="5" type="Other">
  122.         <frequency>Monthly</frequency>
  123.         <income_ind />
  124.       </income>
  125.       <income sequence_number="6" type="Other">
  126.         <frequency>Monthly</frequency>
  127.       </income>
  128.       <expenditure type="Agreed general">
  129.         <amount />
  130.       </expenditure>
  131.       <expenditure type="Agreed mortgage">
  132.         <amount />
  133.       </expenditure>
  134.       <expenditure type="Agreed liability">
  135.         <amount />
  136.       </expenditure>
  137.       <expenditure type="Agreed protection policy">
  138.         <amount />
  139.       </expenditure>
  140.       <expenditure type="Agreed investment policy">
  141.         <amount />
  142.       </expenditure>
  143.       <expenditure type="Rent">
  144.         <amount />
  145.       </expenditure>
  146.       <expenditure type="Council tax">
  147.         <amount />
  148.       </expenditure>
  149.       <expenditure type="Utilities">
  150.         <amount />
  151.       </expenditure>
  152.       <expenditure type="Telephone">
  153.         <amount />
  154.       </expenditure>
  155.       <expenditure type="Food">
  156.         <amount />
  157.       </expenditure>
  158.       <expenditure type="Travel">
  159.         <amount />
  160.       </expenditure>
  161.       <expenditure type="Leisure">
  162.         <amount />
  163.       </expenditure>
  164.       <expenditure type="General insurance">
  165.         <amount />
  166.       </expenditure>
  167.       <expenditure type="Estimated">
  168.         <amount />
  169.       </expenditure>
  170.       <expenditure type="General total">
  171.         <amount>0</amount>
  172.       </expenditure>
  173.       <affordability type="Net disposable income">
  174.         <amount>0</amount>
  175.       </affordability>
  176.       <affordability type="Prepared to spend">
  177.         <amount />
  178.       </affordability>
  179.       <affordability type="Lumpsums">
  180.         <information_ind code="" type="Available lump sums" />
  181.       </affordability>
  182.       <retirement>
  183.         <company_pension>
  184.           <future_joining_date />
  185.         </company_pension>
  186.         <information_ind type="Divorced Pension" code="" />
  187.       </retirement>
  188.       <investment />
  189.       <estate>
  190.         <notes type="Steps taken" />
  191.         <notes type="Will restructure" />
  192.         <notes type="Use of trusts" />
  193.         <notes type="Making gifts" />
  194.         <notes type="Funding life assurance" />
  195.         <notes type="Equalising estate" />
  196.       </estate>
  197.       <need type="Critical Illness">
  198.         <in_scope_ind code="Y">Yes</in_scope_ind>
  199.         <description>A cash sum if critically ill</description>
  200.         <required type="Lump sum">
  201.           <amount />
  202.         </required>
  203.         <required type="Future liabilities">
  204.           <amount />
  205.         </required>
  206.         <required type="Extra living costs">
  207.           <amount />
  208.         </required>
  209.         <required type="Total">
  210.           <amount>0</amount>
  211.         </required>
  212.         <duration>
  213.           <years />
  214.         </duration>
  215.         <existing_provision type="CI policies" />
  216.         <existing_provision type="Investments" />
  217.         <existing_provision type="Other capital" />
  218.         <existing_provision type="Total">0</existing_provision>
  219.         <shortfall>0</shortfall>
  220.         <attitude_to_risk />
  221.       </need>
  222.       <need type="Family Protection Income">
  223.         <in_scope_ind code="N">No</in_scope_ind>
  224.         <description>Providing an income for Dependants on death</description>
  225.         <required type="Income" />
  226.         <required type="Lump sum" />
  227.         <duration>
  228.           <whole_of_life_ind />
  229.         </duration>
  230.         <existing_provision type="Life policies lump sums" />
  231.         <existing_provision type="Investment lump sums" />
  232.         <existing_provision type="Other capital" />
  233.         <existing_provision type="Death in service" />
  234.         <existing_provision type="Total lump sums" />
  235.         <existing_provision type="Life policies income" />
  236.         <existing_provision type="Investment income" />
  237.         <existing_provision type="Dependants pension" />
  238.         <existing_provision type="State Benefits" />
  239.         <existing_provision type="Total income" />
  240.         <shortfall type="Income" />
  241.         <shortfall type="Lump sum" />
  242.       </need>
  243.       <need type="Family Protection Lumpsum">
  244.         <in_scope_ind code="N">No</in_scope_ind>
  245.         <description>Providing a Capital sum on death</description>
  246.         <required type="Lump sum" />
  247.         <duration>
  248.           <whole_of_life_ind />
  249.         </duration>
  250.       </need>
  251.       <need type="Disability">
  252.         <in_scope_ind code="N">No</in_scope_ind>
  253.         <description>An income if ill or disabled</description>
  254.         <required />
  255.         <deferred_period />
  256.         <duration />
  257.         <existing_provision type="Emp benefits tp 4 weeks" />
  258.         <existing_provision type="PHI policies to 4 weeks" />
  259.         <existing_provision type="Emp benefits to 13 weeks" />
  260.         <existing_provision type="PHI policies to 13 weeks" />
  261.         <existing_provision type="Emp benefits to 26 weeks" />
  262.         <existing_provision type="PHI policies to 26 weeks" />
  263.         <existing_provision type="Emp benefits to 52 weeks" />
  264.         <existing_provision type="PHI policies to 52 weeks" />
  265.         <existing_provision type="Emp benefits to expiry" />
  266.         <existing_provision type="PHI policies to expiry" />
  267.         <shortfall type="To expiry" />
  268.       </need>
  269.       <need type="Mortgage/Loans">
  270.         <in_scope_ind code="N">No</in_scope_ind>
  271.         <description>Protection for your Mortgage/Loans</description>
  272.         <required type="Mortgages/Loans" />
  273.         <required type="Liabilities" />
  274.         <required type="Total" />
  275.         <duration />
  276.         <existing_provision type="Sums Assured" />
  277.         <existing_provision type="CI benefits" />
  278.         <existing_provision type="Other capital" />
  279.         <existing_provision type="Total on death" />
  280.         <existing_provision type="Total on critical illness" />
  281.         <shortfall type="On death" />
  282.         <shortfall type="On critical illness" />
  283.       </need>
  284.       <need type="Family Protection">
  285.         <in_scope_ind code="N">No</in_scope_ind>
  286.       </need>
  287.       <need type="Retirement Income">
  288.         <in_scope_ind code="Y">Yes</in_scope_ind>
  289.         <description>Improving retirement income</description>
  290.         <required />
  291.         <notes type="Transitional Protection" />
  292.         <notes type="Certificate Details" />
  293.         <notes type="ASP Details" />
  294.         <information_ind type="Transitional Protection" />
  295.         <information_ind type="Someone else ASP" />
  296.       </need>
  297.       <need type="Long Term Care">
  298.         <in_scope_ind code="Y">Yes</in_scope_ind>
  299.         <description>Long term care</description>
  300.         <required type="Cost of care">
  301.           <amount>20000</amount>
  302.         </required>
  303.         <required type="Partner Income">
  304.           <amount />
  305.         </required>
  306.         <existing_provision type="Investment Income">0</existing_provision>
  307.         <existing_provision type="Pension Income">0</existing_provision>
  308.         <existing_provision type="State Benefits" />
  309.         <shortfall>20000</shortfall>
  310.         <attitude_to_risk />
  311.       </need>
  312.       <need type="IHT first death">
  313.         <in_scope_ind code="N">No</in_scope_ind>
  314.         <description>Inheritance tax planning 1st Death</description>
  315.         <existing_provision type="Non exempt gifts" />
  316.         <existing_provision type="Non exempt trust money" />
  317.         <existing_provision type="Partner assets" />
  318.         <existing_provision type="IHT exemptions" />
  319.         <existing_provision type="Total estate" />
  320.         <existing_provision type="Tax free estate" />
  321.         <existing_provision type="Taxable estate" />
  322.         <shortfall type="IHT first death" />
  323.         <notes type="Non exempt gifts" />
  324.         <notes type="Non exempt trust money" />
  325.         <notes type="IHT exemptions" />
  326.       </need>
  327.       <need type="IHT second death">
  328.         <in_scope_ind code="N">No</in_scope_ind>
  329.         <description>Inheritance tax planning 2nd Death</description>
  330.         <existing_provision type="Non exempt gifts" />
  331.         <existing_provision type="Non exempt trust money" />
  332.         <existing_provision type="Sums liable" />
  333.         <existing_provision type="IHT exemptions" />
  334.         <existing_provision type="Total estate" />
  335.         <existing_provision type="Tax free estate" />
  336.         <existing_provision type="Taxable estate" />
  337.         <shortfall type="IHT second death" />
  338.         <notes type="IHT exemptions" />
  339.         <notes type="Sums liable" />
  340.       </need>
  341.       <need type="Investments">
  342.         <in_scope_ind code="N">No</in_scope_ind>
  343.         <description>Review your lump sum investment options</description>
  344.         <required type="Income" />
  345.         <deferred_period />
  346.         <duration />
  347.         <existing_provision type="Agreed investment amount" />
  348.         <commitment type="Planned expenditure" />
  349.         <commitment type="Debt repayment" />
  350.         <commitment type="Client pension" />
  351.         <commitment type="Cash reserve" />
  352.         <commitment type="Total" />
  353.         <commitment type="Available to invest" />
  354.         <notes type="Investment reason" />
  355.         <notes type="Goals not achieved" />
  356.         <notes type="Income reason" />
  357.         <notes type="Agreed investment source" />
  358.       </need>
  359.       <need type="Savings">
  360.         <in_scope_ind code="N">No</in_scope_ind>
  361.         <description>Saving for that special occasion</description>
  362.         <commitment type="Prepared to save" />
  363.         <notes type="Savings reason" />
  364.         <notes type="Savings other reason" />
  365.       </need>
  366.       <need type="LTC Calculator">
  367.         <in_scope_ind code="N">No</in_scope_ind>
  368.         <required type="Cost of care" />
  369.         <required type="Partner Income" />
  370.         <existing_provision type="Investment Income" />
  371.         <existing_provision type="Pension Income" />
  372.         <existing_provision type="State Benefits" />
  373.         <shortfall />
  374.       </need>
  375.       <need type="Replacement policy">
  376.         <notes type="Policy details" />
  377.         <notes type="Reason" />
  378.         <notes type="Consequences" />
  379.         <notes type="Other options" />
  380.       </need>
  381.       <customer_reference_number />
  382.       <CIS_number />
  383.       <proof_of_identity>
  384.         <id_verification />
  385.         <address_verification />
  386.         <document type="Customer ID">
  387.           <date type="Issue/Expiry" />
  388.         </document>
  389.         <document type="Address ID">
  390.           <date type="Issue/Expiry" />
  391.         </document>
  392.         <notes type="ID Benefit type" />
  393.         <notes type="Other ID Benefit type" />
  394.         <notes type="Address" />
  395.         <notes type="Other address verification" />
  396.         <notes type="Address Benefit type" />
  397.         <notes type="Other address benefit type" />
  398.         <notes type="Proof of Identity" />
  399.         <date_obtained>
  400.           <date />
  401.         </date_obtained>
  402.       </proof_of_identity>
  403.       <information_ind type="Accounts" />
  404.       <information_ind type="Fixed interest" />
  405.       <information_ind type="Cash ISAs" />
  406.       <information_ind type="Equity ISAs" />
  407.       <information_ind type="Shares" />
  408.       <information_ind type="Bonds" />
  409.       <information_ind type="Unit trusts" />
  410.       <information_ind type="Annuities" />
  411.       <information_ind type="Various" />
  412.       <notes type="Investment ISA Cash amount" />
  413.     </party>
  414.     <party id="Partner" sequence_number="2" type="Partner">
  415.       <full_name />
  416.       <notes type="Personal" />
  417.       <notes type="Contact" />
  418.       <notes type="Income Summary" />
  419.       <notes type="Earned income" />
  420.       <notes type="Other income" />
  421.       <notes type="Employee benefits" />
  422.       <contact>
  423.         <address />
  424.         <telephone type="daytime" />
  425.         <telephone type="evening" />
  426.         <telephone type="mobile" />
  427.         <email />
  428.         <same_as />
  429.       </contact>
  430.       <nationality />
  431.       <health>
  432.         <notes type="Health" />
  433.       </health>
  434.       <employment sequence_number="1">
  435.         <earnings type="Basic">
  436.           <frequency>Annually</frequency>
  437.         </earnings>
  438.         <earnings type="Bonus">
  439.           <frequency>Annually</frequency>
  440.         </earnings>
  441.         <earnings type="Payslip">
  442.           <frequency>Monthly</frequency>
  443.         </earnings>
  444.         <start_date />
  445.       </employment>
  446.       <employment sequence_number="2">
  447.         <earnings type="Basic">
  448.           <frequency>Annually</frequency>
  449.         </earnings>
  450.         <earnings type="Bonus">
  451.           <frequency>Annually</frequency>
  452.         </earnings>
  453.         <earnings type="Total">
  454.           <frequency>Monthly</frequency>
  455.         </earnings>
  456.       </employment>
  457.       <employment sequence_number="3">
  458.         <benefit type="Death in service" />
  459.         <benefit type="Dependants pension" />
  460.         <benefit type="Sickness period 1">
  461.           <duration />
  462.           <earnings_related />
  463.         </benefit>
  464.         <benefit type="Sickness period 2">
  465.           <duration />
  466.           <earnings_related />
  467.         </benefit>
  468.       </employment>
  469.       <income sequence_number="1" type="Agreed investment and asset">
  470.         <frequency>Monthly</frequency>
  471.       </income>
  472.       <income sequence_number="9" type="Other Total" />
  473.       <income type="State benefits">
  474.         <frequency>Monthly</frequency>
  475.       </income>
  476.       <income sequence_number="1" type="Earned">
  477.         <frequency>Annually</frequency>
  478.       </income>
  479.       <income sequence_number="1" type="Earned and Other">
  480.         <frequency>Monthly</frequency>
  481.       </income>
  482.       <income sequence_number="1" type="Other">
  483.         <frequency>Monthly</frequency>
  484.         <income_ind />
  485.       </income>
  486.       <income sequence_number="2" type="Other">
  487.         <frequency>Monthly</frequency>
  488.         <income_ind />
  489.       </income>
  490.       <income sequence_number="3" type="Other">
  491.         <frequency>Monthly</frequency>
  492.         <income_ind />
  493.       </income>
  494.       <income sequence_number="4" type="Other">
  495.         <frequency>Monthly</frequency>
  496.         <income_ind />
  497.       </income>
  498.       <income sequence_number="5" type="Other">
  499.         <frequency>Monthly</frequency>
  500.         <income_ind />
  501.       </income>
  502.       <income sequence_number="6" type="Other">
  503.         <frequency>Monthly</frequency>
  504.       </income>
  505.       <expenditure type="Agreed general" />
  506.       <expenditure type="Agreed mortgage" />
  507.       <expenditure type="Agreed liability" />
  508.       <expenditure type="Agreed protection policy" />
  509.       <expenditure type="Agreed investment policy" />
  510.       <expenditure type="Rent" />
  511.       <expenditure type="Council tax" />
  512.       <expenditure type="Utilities" />
  513.       <expenditure type="Telephone" />
  514.       <expenditure type="Food" />
  515.       <expenditure type="Travel" />
  516.       <expenditure type="Leisure" />
  517.       <expenditure type="General insurance" />
  518.       <expenditure type="Estimated" />
  519.       <expenditure type="General total" />
  520.       <affordability type="Net disposable income" />
  521.       <retirement>
  522.         <company_pension>
  523.           <future_joining_date />
  524.         </company_pension>
  525.         <information_ind type="Divorced Pension" />
  526.       </retirement>
  527.       <investment />
  528.       <estate>
  529.         <notes type="Steps taken" />
  530.         <notes type="Will restructure" />
  531.         <notes type="Use of trusts" />
  532.         <notes type="Making gifts" />
  533.         <notes type="Funding life assurance" />
  534.         <notes type="Equalising estate" />
  535.       </estate>
  536.       <need type="Critical Illness">
  537.         <in_scope_ind code="N">No</in_scope_ind>
  538.         <description>A cash sum if critically ill</description>
  539.         <required type="Lump sum" />
  540.         <required type="Future liabilities" />
  541.         <required type="Extra living costs" />
  542.         <required type="Total" />
  543.         <duration />
  544.         <existing_provision type="CI policies" />
  545.         <existing_provision type="Investments" />
  546.         <existing_provision type="Other capital" />
  547.         <existing_provision type="Total" />
  548.         <shortfall />
  549.       </need>
  550.       <need type="Family Protection Income">
  551.         <in_scope_ind code="N">No</in_scope_ind>
  552.         <description>Providing an income for Dependants on death</description>
  553.         <required type="Income" />
  554.         <required type="Lump sum" />
  555.         <duration>
  556.           <whole_of_life_ind />
  557.         </duration>
  558.         <existing_provision type="Life policies lump sums" />
  559.         <existing_provision type="Investment lump sums" />
  560.         <existing_provision type="Other capital" />
  561.         <existing_provision type="Death in service" />
  562.         <existing_provision type="Total lump sums" />
  563.         <existing_provision type="Life policies income" />
  564.         <existing_provision type="Investment income" />
  565.         <existing_provision type="Dependants pension" />
  566.         <existing_provision type="State Benefits" />
  567.         <existing_provision type="Total income" />
  568.         <shortfall type="Income" />
  569.         <shortfall type="Lump sum" />
  570.       </need>
  571.       <need type="Family Protection Lumpsum">
  572.         <in_scope_ind code="N">No</in_scope_ind>
  573.         <description>Providing a Capital sum on death</description>
  574.         <required type="Lump sum" />
  575.         <duration>
  576.           <whole_of_life_ind />
  577.         </duration>
  578.       </need>
  579.       <need type="Disability">
  580.         <in_scope_ind code="N">No</in_scope_ind>
  581.         <description>An income if ill or disabled</description>
  582.         <required />
  583.         <deferred_period />
  584.         <duration />
  585.         <existing_provision type="Emp benefits to 4 weeks" />
  586.         <existing_provision type="PHI policies to 4 weeks" />
  587.         <existing_provision type="Emp benefits to 13 weeks" />
  588.         <existing_provision type="PHI policies to 13 weeks" />
  589.         <existing_provision type="Emp benefits to 26 weeks" />
  590.         <existing_provision type="PHI policies to 26 weeks" />
  591.         <existing_provision type="Emp benefits to 52 weeks" />
  592.         <existing_provision type="PHI policies to 52 weeks" />
  593.         <existing_provision type="Emp benefits to expiry" />
  594.         <existing_provision type="PHI policies to expiry" />
  595.         <shortfall type="To expiry" />
  596.       </need>
  597.       <need type="Mortgage/Loans">
  598.         <in_scope_ind code="N">No</in_scope_ind>
  599.         <description>Protection for your Mortgage/Loans</description>
  600.         <required type="Mortgages/Loans" />
  601.         <required type="Liabilities" />
  602.         <required type="Total" />
  603.         <duration />
  604.         <existing_provision type="Sums Assured" />
  605.         <existing_provision type="CI benefits" />
  606.         <existing_provision type="Other capital" />
  607.         <existing_provision type="Total on death" />
  608.         <existing_provision type="Total on critical illness" />
  609.         <shortfall type="On death" />
  610.         <shortfall type="On critical illness" />
  611.       </need>
  612.       <need type="Family Protection">
  613.         <in_scope_ind code="N">No</in_scope_ind>
  614.       </need>
  615.       <need type="Retirement Income">
  616.         <in_scope_ind code="N">No</in_scope_ind>
  617.         <description>Improving retirement income</description>
  618.         <required />
  619.         <notes type="Transitional Protection" />
  620.         <notes type="Certificate Details" />
  621.         <notes type="ASP Details" />
  622.         <information_ind type="Transitional Protection" />
  623.         <information_ind type="Someone else ASP" />
  624.       </need>
  625.       <need type="Long Term Care">
  626.         <in_scope_ind code="N">No</in_scope_ind>
  627.         <description>Long term care</description>
  628.         <required type="Cost of care" />
  629.         <required type="Partner Income" />
  630.         <existing_provision type="Investment Income" />
  631.         <existing_provision type="Pension Income" />
  632.         <existing_provision type="State Benefits" />
  633.         <shortfall />
  634.       </need>
  635.       <need type="LTC Calculator">
  636.         <in_scope_ind code="N">No</in_scope_ind>
  637.         <required type="Cost of care" />
  638.         <required type="Partner Income" />
  639.         <existing_provision type="Investment Income" />
  640.         <existing_provision type="Pension Income" />
  641.         <existing_provision type="State Benefits" />
  642.         <shortfall />
  643.       </need>
  644.       <need type="IHT first death">
  645.         <in_scope_ind code="N">No</in_scope_ind>
  646.         <description>Inheritance tax planning 1st Death</description>
  647.         <existing_provision type="Non exempt gifts" />
  648.         <existing_provision type="Non exempt trust money" />
  649.         <existing_provision type="Partner assets" />
  650.         <existing_provision type="IHT exemptions" />
  651.         <existing_provision type="Total estate" />
  652.         <existing_provision type="Tax free estate" />
  653.         <existing_provision type="Taxable estate" />
  654.         <shortfall type="IHT first death" />
  655.         <notes type="Non exempt gifts" />
  656.         <notes type="Non exempt trust money" />
  657.         <notes type="IHT exemptions" />
  658.       </need>
  659.       <need type="IHT second death">
  660.         <in_scope_ind code="N">No</in_scope_ind>
  661.         <description>Inheritance tax planning 2nd Death</description>
  662.         <existing_provision type="Non exempt gifts" />
  663.         <existing_provision type="Non exempt trust money" />
  664.         <existing_provision type="Sums liable" />
  665.         <existing_provision type="IHT exemptions" />
  666.         <existing_provision type="Total estate" />
  667.         <existing_provision type="Tax free estate" />
  668.         <existing_provision type="Taxable estate" />
  669.         <shortfall type="IHT second death" />
  670.         <notes type="IHT exemptions" />
  671.         <notes type="Sums liable" />
  672.       </need>
  673.       <need type="Investments">
  674.         <in_scope_ind code="N">No</in_scope_ind>
  675.         <description>Review your lump sum investment options</description>
  676.         <required type="Income" />
  677.         <deferred_period />
  678.         <duration />
  679.         <existing_provision type="Agreed investment amount" />
  680.         <commitment type="Planned expenditure" />
  681.         <commitment type="Debt repayment" />
  682.         <commitment type="Partner pension" />
  683.         <commitment type="Cash reserve" />
  684.         <commitment type="Total" />
  685.         <commitment type="Available to invest" />
  686.         <notes type="Investment reason" />
  687.         <notes type="Goals not achieved" />
  688.         <notes type="Income reason" />
  689.         <notes type="Agreed investment source" />
  690.       </need>
  691.       <need type="Savings">
  692.         <in_scope_ind code="N">No</in_scope_ind>
  693.         <description>Saving for that special occasion</description>
  694.         <commitment type="Prepared to save" />
  695.         <notes type="Savings reason" />
  696.         <notes type="Savings other reason" />
  697.       </need>
  698.       <customer_reference_number />
  699.       <CIS_number />
  700.       <proof_of_identity>
  701.         <id_verification />
  702.         <address_verification />
  703.         <document type="Customer ID">
  704.           <date type="Issue/Expiry" />
  705.         </document>
  706.         <document type="Address ID">
  707.           <date type="Issue/Expiry" />
  708.         </document>
  709.         <notes type="ID Benefit type" />
  710.         <notes type="Other ID Benefit type" />
  711.         <notes type="Address" />
  712.         <notes type="Other address verification" />
  713.         <notes type="Address Benefit type" />
  714.         <notes type="Other address benefit type" />
  715.         <notes type="Proof of Identity" />
  716.         <date_obtained>
  717.           <date />
  718.         </date_obtained>
  719.       </proof_of_identity>
  720.       <information_ind type="Accounts" />
  721.       <information_ind type="Fixed interest" />
  722.       <information_ind type="Cash ISAs" />
  723.       <information_ind type="Equity ISAs" />
  724.       <information_ind type="Shares" />
  725.       <information_ind type="Bonds" />
  726.       <information_ind type="Unit trusts" />
  727.       <information_ind type="Annuities" />
  728.       <information_ind type="Various" />
  729.       <notes type="Investment ISA Cash amount" />
  730.     </party>
  731.     <party id="Joint" type="Joint" sequence_number="3">
  732.       <known_as />
  733.       <expenditure type="Agreed general" />
  734.       <expenditure type="Agreed mortgage" />
  735.       <expenditure type="Agreed liability" />
  736.       <expenditure type="Agreed protection policy" />
  737.       <expenditure type="Agreed investment policy" />
  738.       <expenditure type="Rent" />
  739.       <expenditure type="Council tax" />
  740.       <expenditure type="Utilities" />
  741.       <expenditure type="Telephone" />
  742.       <expenditure type="Food" />
  743.       <expenditure type="Travel" />
  744.       <expenditure type="Leisure" />
  745.       <expenditure type="General insurance" />
  746.       <expenditure type="Estimated" />
  747.       <expenditure type="General total" />
  748.       <affordability type="Net disposable income" />
  749.       <need type="Savings">
  750.         <in_scope_ind code="N">No</in_scope_ind>
  751.         <description>Saving for that special occasion</description>
  752.         <commitment type="Prepared to save" />
  753.         <notes type="Savings reason" />
  754.         <notes type="Savings other reason" />
  755.       </need>
  756.       <need type="Investments">
  757.         <in_scope_ind code="N">No</in_scope_ind>
  758.         <description>Review your lump sum investment options</description>
  759.         <required type="Income" />
  760.         <deferred_period />
  761.         <duration />
  762.         <existing_provision type="Agreed investment amount" />
  763.         <commitment type="Planned expenditure" />
  764.         <commitment type="Debt repayment" />
  765.         <commitment type="Client pension" />
  766.         <commitment type="Partner pension" />
  767.         <commitment type="Cash reserve" />
  768.         <commitment type="Total" />
  769.         <commitment type="Available to invest" />
  770.         <notes type="Investment reason" />
  771.         <notes type="Goals not achieved" />
  772.         <notes type="Income reason" />
  773.         <notes type="Agreed investment source" />
  774.       </need>
  775.       <need type="Mortgage/Loans">
  776.         <in_scope_ind code="N">No</in_scope_ind>
  777.         <description>Protection for your Mortgage/Loans</description>
  778.         <required type="Mortgages/Loans" />
  779.         <required type="Liabilities" />
  780.         <required type="Total" />
  781.         <duration />
  782.         <existing_provision type="Sums Assured" />
  783.         <existing_provision type="CI benefits" />
  784.         <existing_provision type="Other capital" />
  785.         <existing_provision type="Total on death" />
  786.         <existing_provision type="Total on critical illness" />
  787.         <shortfall type="On death" />
  788.         <shortfall type="On critical illness" />
  789.       </need>
  790.       <information_ind type="Accounts" />
  791.       <information_ind type="Fixed interest" />
  792.       <information_ind type="Cash ISAs" />
  793.       <information_ind type="Equity ISAs" />
  794.       <information_ind type="Shares" />
  795.       <information_ind type="Bonds" />
  796.       <information_ind type="Unit trusts" />
  797.       <information_ind type="Annuities" />
  798.       <information_ind type="Various" />
  799.     </party>
  800.     <adviser type="Financial">
  801.       <full_name>Mr. Test Adviser</full_name>
  802.       <contact>
  803.         <telephone type="daytime">
  804.           <number>(34)5345345</number>
  805.         </telephone>
  806.         <telephone type="mobile">
  807.           <number>(23)4234234</number>
  808.         </telephone>
  809.       </contact>
  810.       <company_reference_number>1232367</company_reference_number>
  811.       <manager sequence_number="1">
  812.         <full_name>Mrs. Jane Smythe</full_name>
  813.         <contact>
  814.           <telephone type="daytime">
  815.             <number>(0000) 4564564</number>
  816.           </telephone>
  817.           <telephone type="mobile">
  818.             <number>(3435) 345 4540</number>
  819.           </telephone>
  820.         </contact>
  821.         <company_reference_number>3214567</company_reference_number>
  822.       </manager>
  823.     </adviser>
  824.     <factfind>
  825.       <asset sequence_number="1">
  826.         <ownership_pc />
  827.         <benefit type="Current value" />
  828.         <benefit type="Income" />
  829.         <notes type="Additional information" />
  830.         <information_ind type="Another asset" />
  831.       </asset>
  832.       <asset sequence_number="2">
  833.         <ownership_pc />
  834.         <benefit type="Current value"