File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes XSLT format transformation? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XSLT format transformation?" Watch "XSLT format transformation?" New topic
Author

XSLT format transformation?

bujin wang
Ranch Hand

Joined: Jun 21, 2003
Posts: 48
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: XSLT format transformation?
 
Similar Threads
Reading value from FILEusing XSLT
get data from Document object
Empty Element
How to deal with the empty element?
How to design this: multiple version support