Get specifc tags from xml file and return them in xml format using xml [duplicate]












0
















This question already has an answer here:




  • How do you parse and process HTML/XML in PHP?

    29 answers



  • Basic simpleXML working example?

    5 answers




assume I have simple xml like this one, and I want to read it in way that I will get the element in xml format.



<?xml version="1.0" encoding="UTF-8"?>
<contentdata>
<Games>
<numberof>2</numberof>
<nameof>
<n1>Game1</n1>
<n2>Game2</n2>
</nameof>
</Games>
<Software>
<numberof>1</numberof>
<nameof>
<n1>Software1</n1>
</nameof>
</Software>
</contentdata>


That means the output after reading should be like below :-
Kindly, assist in any way you can, I will appreciate that.
Thank you.



          <Games>
<numberof>2</numberof>
<nameof>
<n1>Game1</n1>
<n2>Game2</n2>
</nameof>
</Games>









share|improve this question















marked as duplicate by Mohammad, Nigel Ren php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 '18 at 7:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • Hi there, please look at this guide how to ask good questions. Stack Overflow is not a free coding service, so please show what you did or use the search function which should give plenty hints on how to do what you want to achieve

    – Jan
    Nov 19 '18 at 7:21
















0
















This question already has an answer here:




  • How do you parse and process HTML/XML in PHP?

    29 answers



  • Basic simpleXML working example?

    5 answers




assume I have simple xml like this one, and I want to read it in way that I will get the element in xml format.



<?xml version="1.0" encoding="UTF-8"?>
<contentdata>
<Games>
<numberof>2</numberof>
<nameof>
<n1>Game1</n1>
<n2>Game2</n2>
</nameof>
</Games>
<Software>
<numberof>1</numberof>
<nameof>
<n1>Software1</n1>
</nameof>
</Software>
</contentdata>


That means the output after reading should be like below :-
Kindly, assist in any way you can, I will appreciate that.
Thank you.



          <Games>
<numberof>2</numberof>
<nameof>
<n1>Game1</n1>
<n2>Game2</n2>
</nameof>
</Games>









share|improve this question















marked as duplicate by Mohammad, Nigel Ren php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 '18 at 7:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
















  • Hi there, please look at this guide how to ask good questions. Stack Overflow is not a free coding service, so please show what you did or use the search function which should give plenty hints on how to do what you want to achieve

    – Jan
    Nov 19 '18 at 7:21














0












0








0


1







This question already has an answer here:




  • How do you parse and process HTML/XML in PHP?

    29 answers



  • Basic simpleXML working example?

    5 answers




assume I have simple xml like this one, and I want to read it in way that I will get the element in xml format.



<?xml version="1.0" encoding="UTF-8"?>
<contentdata>
<Games>
<numberof>2</numberof>
<nameof>
<n1>Game1</n1>
<n2>Game2</n2>
</nameof>
</Games>
<Software>
<numberof>1</numberof>
<nameof>
<n1>Software1</n1>
</nameof>
</Software>
</contentdata>


That means the output after reading should be like below :-
Kindly, assist in any way you can, I will appreciate that.
Thank you.



          <Games>
<numberof>2</numberof>
<nameof>
<n1>Game1</n1>
<n2>Game2</n2>
</nameof>
</Games>









share|improve this question

















This question already has an answer here:




  • How do you parse and process HTML/XML in PHP?

    29 answers



  • Basic simpleXML working example?

    5 answers




assume I have simple xml like this one, and I want to read it in way that I will get the element in xml format.



<?xml version="1.0" encoding="UTF-8"?>
<contentdata>
<Games>
<numberof>2</numberof>
<nameof>
<n1>Game1</n1>
<n2>Game2</n2>
</nameof>
</Games>
<Software>
<numberof>1</numberof>
<nameof>
<n1>Software1</n1>
</nameof>
</Software>
</contentdata>


That means the output after reading should be like below :-
Kindly, assist in any way you can, I will appreciate that.
Thank you.



          <Games>
<numberof>2</numberof>
<nameof>
<n1>Game1</n1>
<n2>Game2</n2>
</nameof>
</Games>




This question already has an answer here:




  • How do you parse and process HTML/XML in PHP?

    29 answers



  • Basic simpleXML working example?

    5 answers








php xml






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 19 '18 at 8:01







R. Mseti

















asked Nov 19 '18 at 7:19









R. MsetiR. Mseti

136




136




marked as duplicate by Mohammad, Nigel Ren php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 '18 at 7:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






marked as duplicate by Mohammad, Nigel Ren php
Users with the  php badge can single-handedly close php questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Nov 19 '18 at 7:27


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • Hi there, please look at this guide how to ask good questions. Stack Overflow is not a free coding service, so please show what you did or use the search function which should give plenty hints on how to do what you want to achieve

    – Jan
    Nov 19 '18 at 7:21



















  • Hi there, please look at this guide how to ask good questions. Stack Overflow is not a free coding service, so please show what you did or use the search function which should give plenty hints on how to do what you want to achieve

    – Jan
    Nov 19 '18 at 7:21

















Hi there, please look at this guide how to ask good questions. Stack Overflow is not a free coding service, so please show what you did or use the search function which should give plenty hints on how to do what you want to achieve

– Jan
Nov 19 '18 at 7:21





Hi there, please look at this guide how to ask good questions. Stack Overflow is not a free coding service, so please show what you did or use the search function which should give plenty hints on how to do what you want to achieve

– Jan
Nov 19 '18 at 7:21












0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

How to send String Array data to Server using php in android

Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

Is anime1.com a legal site for watching anime?