Hi All,
I am a XML newbie.
I have a the following xml file
<lib>
<book>
<title>XXX</title>
<authour>Mr.A</authour>
</book>
<book>
<title>YYY</title>
<price>26</price>
</book>
<book>
<title>ZZZ</title>
</book>
</lib>
As you see only the 'Title' is required and other parameteres are optional.
I want to trasnform this XML to another XML in the following format
<lib>
<book>
<title>XXX</title>
<authour>Mr.A</authour>
<price>null</price>
</book>
<book>
<title>YYY</title>
<authour>null</authour>
<price>26</price>
</book>
<book>
<title>ZZZ</title>
<authour>null</authour>
<price>null</price>
</book>
</lib>
In my case I have like 10-15 optional fields and I want to know the best way to do this transformation in XSL.
Can someone provide me an example of XSL that I would need for the conversion?
Thanks,
Mohan
I am a XML newbie.
I have a the following xml file
<lib>
<book>
<title>XXX</title>
<authour>Mr.A</authour>
</book>
<book>
<title>YYY</title>
<price>26</price>
</book>
<book>
<title>ZZZ</title>
</book>
</lib>
As you see only the 'Title' is required and other parameteres are optional.
I want to trasnform this XML to another XML in the following format
<lib>
<book>
<title>XXX</title>
<authour>Mr.A</authour>
<price>null</price>
</book>
<book>
<title>YYY</title>
<authour>null</authour>
<price>26</price>
</book>
<book>
<title>ZZZ</title>
<authour>null</authour>
<price>null</price>
</book>
</lib>
In my case I have like 10-15 optional fields and I want to know the best way to do this transformation in XSL.
Can someone provide me an example of XSL that I would need for the conversion?
Thanks,
Mohan