xsl-list
[Top] [All Lists]

Using an XSLT to merge two XMLs then apply itself (or another XSL) to the result

2006-02-09 15:49:26
I have what I consider to be a major head-ache and I have searched (google) high-up and low-down. I now realise, I don't really understand XSL all that well.

The problem:

        myprocess.transform ( xsl-a, xml-f );

I need to have an XSL (xsl-a) take the supplied xml file (xml-f) and stick it into a specific node that resides in an external XML document (xml-e), take the combined xml DOM (xml-c) and process it with a final xsl (xsl-b) to produce the required output.

How:

I am confused and dis-orientated.

While currently programmed in C# under .NET 2.0, this XSL and XML will need to be processed under Java using Xalan as well - so I need a plain-vanilla solution. I would prefer not to perform two seperate XSLTs in the code for this special case only.

xml-f:
<?xml version="1.0" encoding="UTF-8"?>
<support>
        <first-name>Mickey</first-name>
        <last-name>Mouse</last-name>
        <user-name>mmouse</user-name>
        <password/>
        <email>mickey(_at_)disney(_dot_)com</email>
        <network-status>ACTIVE</network-status>
</support>

xml-e
<?xml version="1.0" encoding="UTF-8"?>
<root-node>
        <random-nodes>
                <instance>
                        <!-- Each of the child nodes of xml-f:<support> need to 
be inserted here
-->
                </instance>
        </random-nodes>
        <other-random-nodes>
        </other-random-nodes>
</root-node>


xml-c: Should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<root-node>
        <random-nodes>
                <instance>
                        <first-name>Mickey</first-name>
                        <last-name>Mouse</last-name>
                        <user-name>mmouse</user-name>
                        <password/>
                        <email>mickey(_at_)disney(_dot_)com</email>
                        <network-status>ACTIVE</network-status>
                </instance>
        </random-nodes>
        <other-random-nodes>
        </other-random-nodes>
</root-node>

** Then I need to process this combined xml-c DOM using another XSL (xsl-b).
**

Thanks in advance for any help you may give.

_________________________________________________________________
MSN Toolbar now comes with Windows Desktop Search - FREE download! http://desktop.msn.ie/


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