[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

overwriting certain blocks of output - two queries

Subject: overwriting certain blocks of output - two queries
From: Rahil <qamar_rahil@xxxxxxxxxxx>
Date: Wed, 25 May 2005 18:31:26 +0100
coded_text
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.