[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

[xsl] Question about variable-field lookup tables

Subject: [xsl] Question about variable-field lookup tables
From: Mir Farooq Ali <miali@xxxxxxxxxxxxxxxx>
Date: Mon, 12 Jan 2004 11:41:59 -0500 (EST)


I need some help with a particular problem I'm trying to solve. I need to
transform an xml document that is based partially on information that is
extracted from another xml file whose purpose is to act like a lookup
table. However, the wrinkle is that the values extracted from the lookup
table are xml fragments that might be one or more fields.

An sample of the xml lookup file looks like this

   <TC name="a">
     <TTM type="b">
        <UCM preference="1">
              <pa prefnum="1">
              <pa prefnum="2">

The xml file that needs to be tranformed looks something like this

    <T id="something" TC="a">

Based on the lookup from the first file, since the UPS value is 1, the
corresonding XML fragment from above
needs to be *modified* and copied into the output tree. The above code
will have to look something like this

      <p c="XXXX">
         <p c="YYYY"/>
         <p c="ZZZZ"/>

If on the other hand, the UPS value was 2, then the lookup matches the
second XML fragment and the code will be

     <p c="WWWW"/>

The problem I'm having is to figure out how to do the *copy and
tranformation* of the xml fragment since I don't know deeply nested it
might be. I'm stumped in thinking of an elegant solution to this problem.

Any help is appreciated.


Mir Farooq Ali

Computer Science, Virginia Tech,
Email: miali@xxxxxxxxx
Web: http://purl.org/net/farooq
(c) 2004 Mir Farooq Ali  All rights reserved

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread