How to use XSLT to transform XML according to the data in another XML

A

ai2003lian

I have a XML containing more information than required. And I want to
transform it to a XML with less information according to the
requirement data in another XML. How could I accomplish this using
XSLT?

Here're the XML files:

source.xml :

<AllFields>
<field name="f1", type="N">value1</field>
<field name="f2", type="N">value1</field>
<field name="f3", type="N">value1</field>
<field name="f4", type="N">value1</field>

....
</AllFields>

requirement.xml :

<requiredFields>
<field>f1</field>
<field>f3</field>
</requiredFields>

result.xml :

<AllFields>
<field name="f1", type="N">value1</field>
<field name="f3", type="N">value1</field>
</AllFields>

Thanks in advance!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top