posted 20 years ago
Hi Developers,
Recently I am working with two version of xml files. They essentially provide the same information. Some tags are moved around; some are renamed. Currently the parser can only parse one version. I have got the option to extend the old parser to parse the new format. However I heard that XSLT could the transformation for me. That way I don't have to worry about parsers. There are some changes I am not sure whether XSLT could handle. for example:
In our old format, c is under b.
[CODE]
---------------------------------------------------------------------------
a
b
c
This is c
/c
/b
/a
In the new format, c is moved from b, but still b needs to refer to c:
<a>
<b refName="aaa">
...
</b>
</a>
<c name="aaa">
this is c
</c>
---------------------------------------------------------------------------
As we can see, the c in the new format is included through name attribute.
Can xslt template handle this?
What does the stylesheet look like in this case?
Thanks,
Bujin