replace element contents

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dstars
    New Member
    • Jan 2010
    • 1

    replace element contents

    Hi all,

    First wish you all HNY 2010.
    I am new on this fourm and new to XSLT programming.
    Can any one help on following issue...

    <!-- ........XML1... ............>

    Code:
    <purchase>
      <po>
           <article_no>ABCD123456</article_no>
           <supplier_no>Supplier234568</supplier_no>
       </po>
       <po>
           <article_no>PQRS123456</article_no>
           <supplier_no>Supplier567890</supplier_no>
       </po>
    </root>

    <!-- ........XML2... ............>

    Code:
    <sales>
      <order>
           <item_no>ABCD123456</item_no>
           <article_name>Baloons</article_name>
           <article_quantity>24</article_quantity>
           <article_code>2468</article_code>
       </order>
       <order>
           <item_no>PQRS123456</item_no>
           <article_name>Paper Decoration</article_name>
           <article_quantity>10</article_quantity>
           <article_code>1357</article_code>
       </order>
    </sales>
    I have above 2 XML Files.
    I want to comare value of element <article_no> in XML1 file to value of element <item_no> in XML2.
    If both are same then want to replace value of element <item_no> in XML2 with
    corresonding value of element <supplier_no> in XML1 for corresonding <article_no> .
    And also want to change value of <article_quanti ty> & <article_code>a s "-".

    Thanks in advance with support.

    dstars
    Last edited by Dormilich; Jan 16 '10, 01:02 PM. Reason: please use [code] tags when posting code
Working...