• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XSLT format transformation?

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic