We're a community of 1076K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,075,610 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

XSLT to transform XML into XML with specific data

Hi

I have been reading so many tutorials but can't seem to get anywhere, with what I thought would be a simple task.

I have an xml file outputted from some software in the vague format:

<root>

<one>data</one>

<two>more data</two>

<three> even more data</three>

</root>

Fairly straight forward data, nothing really nested.

All I am trying to do is use an xslt file to transform this xml into a new XML file, but with only a few selected fields, e.g. the same structure as before, but only one of the tags

I have tried so many different methods, and I either get nothing at all, or all my data in the new xml file just without tags.

Any clues where to start? To me this looked simple, all the tutorials looked fairly simple, I tried copying them and adjusted for my data, but no avail.

Thanks

3
Contributors
3
Replies
1 Month
Discussion Span
5 Months Ago
Last Updated
5
Views
duffman69
Newbie Poster
2 posts since Oct 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

As is usually the case, I think I've got the bottom of what the problem was.

I had a custom namespace in the root node of the XML, which I didnt realise I needed to put in the XSLT file, and then reference that namespace.

duffman69
Newbie Poster
2 posts since Oct 2012
Reputation Points: 0
Solved Threads: 0
Skill Endorsements: 0

Thats a common problem duffman, I got caught out by it until someone told me you needed to include it also.

MikeyIsMe
Master Poster
798 posts since Nov 2010
Reputation Points: 88
Solved Threads: 69
Skill Endorsements: 10

It’s a matter of glee that .we are getting help and benefits from your post . this post is really awesome I ever seen . peoples are also expecting this kind of post . I am thanking the admin who wade it ready for us.

raihan.ikbal
Newbie Poster
4 posts since Sep 2012
Reputation Points: -4
Solved Threads: 1
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.5461 seconds using 2.91MB