xsl-list
[Top] [All Lists]

RE: Merging two xml documents using xslt

2005-02-01 14:24:48
You're absolutely right. For the 2nd part, I've found a solution posted at
this forum last year by Albuquerque
(http://www.biglist.com/lists/xsl-list/archives/200301/msg01384.html).

The posted code works great - however, if I call this xslt from C#
programmatically (by passing 'path' and 'value' as parameters), it never
works. Maybe I should try other API to see if it's C# bug.

On the other hand, I need to pass in an array of string/value, and I just
couldn't figure out how to do it in xslt (without using saxon etc.).

Anyway, thanks for all the help I've got so far - this forum is great!

Jianyu Lai

----------------------------------------------------------------------------
To:  <xsl-list(_at_)xxxxxxxxxxxxxxxxxxxxxx> 
Subject:  RE: [xsl] Merging two xml documents using xslt  
From:  "Michael Kay" <mike(_at_)xxxxxxxxxxxx> 
Date:  Tue, 1 Feb 2005 20:03:10 -0000 

That helps. If you don't want to use it, pretty much the only way to 
achieve what was requested is by a two-stage process.

Stage 1 would run a stylesheet on the configuration document 
to generate a 
stylesheet.

Stage 2 would run the resulting stylesheet on the source document(s).

Using saxon:evaluate should allow you to do it in one pass.

It's a little bit trickier than that, because the XPath expression
identified elements to be modified. Evaluating a dynamic XPath expression to
give a set of nodes is one thing; writing a stylesheet that modifies the
nodes in the result of that expression is another.

Also there are multiple expressions, and doing one pass (i.e. a document
copy) for each expression sounds expensive.

If the expressions are constrained to be XSLT patterns, then it would
probably be easier to generate a stylesheet dynamically in this situation.

Michael Kay
http://www.saxonica.com/



--~------------------------------------------------------------------
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>
--~--