1,105,232 Community Members

XSLT to transform XML into XML with specific data

duffman69
Newbie Poster
2 posts since Oct 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

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

duffman69
Newbie Poster
2 posts since Oct 2012
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
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.

Member Avatar
Mike Askew
Posting Shark
925 posts since Nov 2010
Reputation Points: 132 [?]
Q&As Helped to Solve: 85 [?]
Skill Endorsements: 25 [?]
Featured
 
0
 

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

Member Avatar
raihan.ikbal
Newbie Poster
4 posts since Sep 2012
Reputation Points: -4 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
-1
 

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.

You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
View similar articles that have also been tagged: