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

Recursively applying XSL stylesheets to facilitate 'normaliz

Subject: Recursively applying XSL stylesheets to facilitate 'normalizing' data
From: "Kent Fitch" <kent.fitch@xxxxxxxxxxxx>
Date: Wed, 18 Nov 1998 09:40:59 +1100
applying xsl
We are building XML structures which we hope to
render into HTML using XSL and maybe some DOM
programming.

An issue has arisen about how to best cope with
a need to 'normalize' data (ie, separate out
common fields) and still make it easy to process
using XSL.


For example, imagine contact information is
separated out to a separate place and referenced
from some XML like this:


<project>
  <title>Electro-Polymer Research</title>
  <contactRef staffId=fred type=manager>
  <contactRef staffId=bill type=publicity>
</project>
<project>
  <title>Prostate Cancer Diagnosis</title>
  <contactRef staffId=jane type=manager>
  <contactRef staffId=bill type=publicity>
</project>

Contact information is held in a separate place
(file, database...) and the key to that information
is the value staffId as used above:

<staff id=bill>
 <forenames>William</fornames>
 <surname>Smith</surname>
 <phone> ... <fax> ... <email> ... <mobile>... etc
</staff>


We want to 'expand' the reference to 'bill', 'fred'
or 'jane' whilst processing the project document.

We experimented using the new IE5 beta XML/XSL tools
as follows:

1) XSL stylesheet comes across the contactRef and
   using <xsl:eval> passes it to a script
2) the script looks at the attributes and using
   them locates the fragment of contact information
3) the script then creates an Microsoft.XMLDOM
   object, passes it this contact information and
   invokes another stylesheet on it.

Step 3 fails giving the error "Automation server can't
create object".

Other approaches we have thought of are:

a) use the DOM to find all contactRef nodes and
   replace them with the relevant contact details in the
   project tree, and then invoke the XSL stylesheet

or 

b) get the XSL stylesheet to generate a marker in the
   output HTML (eg "***REPLACE ME WITH STAFFID='bill'***")
   and then search for these types of strings in the
   XSL output and replace them by:
    - finding & loading the referenced contact info
    - applying a XSL stylesheet to it
    - using the output to replace the above text.

Has anyone else come across this problem and solved it?

kent.fitch@xxxxxxxxxxxx
CSIRO Canberra Australia


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


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.