xsl-list
[Top] [All Lists]

overwriting certain blocks of output - two queries

2005-05-25 10:31:26
Hi

I want to overwrite certain blocks of output (o/p) that I obtain from my first.xsl file with the results from second.xsl.

The process flow is such :

input.xml (call to first.xsl) --> first.xsl (some processing) --> first.xml (use saxon:next-in-chain) -->second.xsl (target certain o/p areas of first.xml) -->second.xml (final result)

first.xml looks such:

<Top>
<Parts>
   <A>
        <Class id="123" type="none">Parts</Class>
        <Value id="345" type="CODED_TEXT">Handle</Value>
   </A>
   <B>
        <Class id="none" type="Property">Handle</Class>
        <Value id="234" type="Property">hasProperty Bolt</Value>
   </B>
</Parts>
<Components>
    <A>
        <Class id="123" type="none">Components</Class>
        <Value id="345" type="CODED_TEXT">Car</Value>
   </A>
   <B>
        <Class id="none" type="none">Not Present</Class>
    </B>
</Components>
</Top>

Now second.xsl processes first.xml by pulling out all B/Class[.='Not Present']. Then it does some stuff and gets some results so that I finally have second.xml looking like this:

<Top>
<Parts>
   <A>
        <Class id="123" type="none">Parts</Class>
        <Value id="345" type="CODED_TEXT">Handle</Value>
   </A>
   <B>
        <Class id="none" type="Property">Handle</Class>
        <Value id="234" type="Property">hasProperty Bolt</Value>
   </B>
</Parts>
<Components>
    <A>
        <Class id="123" type="none">Components</Class>
        <Value id="345" type="CODED_TEXT">Car</Value>
   </A>
   <B>
        <Class id="none" type="876">CarLocks</Class>
         <Value id="909" type="Property">hasProperty Mirror</Value>
    </B>
</Components>
</Top>

How do I overwrite certain nodes while preserving the remaining structure?

Also is it possible to overwrite other blocks of first.xml retrospectively, say the block Top/Parts/A, if a certain condition is met later on ?

Will appreciate any suggestions and help

Thanks
Rahil



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>