Parse .xml file in a specific way

Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
I have the following .xml and I want a specific output:
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
Output:
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
In some cases, I have more than two <ContactPerson> so I would be nice to have a great loop to resolve this. I've tried to resolve the problem with a for loop but I always have the result:
John Wayne 78787878 john.wayne@gmail.com
John Wayne 78787878 john.wayne@gmail.com
text-processing xml
add a comment |Â
up vote
1
down vote
favorite
I have the following .xml and I want a specific output:
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
Output:
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
In some cases, I have more than two <ContactPerson> so I would be nice to have a great loop to resolve this. I've tried to resolve the problem with a for loop but I always have the result:
John Wayne 78787878 john.wayne@gmail.com
John Wayne 78787878 john.wayne@gmail.com
text-processing xml
2
The XML is faulty. It has no root node and<PhoneMobileList>has no end tag. This can not be parsed with an XML parser.
â Kusalananda
Feb 9 at 11:30
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
I have the following .xml and I want a specific output:
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
Output:
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
In some cases, I have more than two <ContactPerson> so I would be nice to have a great loop to resolve this. I've tried to resolve the problem with a for loop but I always have the result:
John Wayne 78787878 john.wayne@gmail.com
John Wayne 78787878 john.wayne@gmail.com
text-processing xml
I have the following .xml and I want a specific output:
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
Output:
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
In some cases, I have more than two <ContactPerson> so I would be nice to have a great loop to resolve this. I've tried to resolve the problem with a for loop but I always have the result:
John Wayne 78787878 john.wayne@gmail.com
John Wayne 78787878 john.wayne@gmail.com
text-processing xml
edited Feb 9 at 12:06
asked Feb 9 at 11:27
lendoiro
163
163
2
The XML is faulty. It has no root node and<PhoneMobileList>has no end tag. This can not be parsed with an XML parser.
â Kusalananda
Feb 9 at 11:30
add a comment |Â
2
The XML is faulty. It has no root node and<PhoneMobileList>has no end tag. This can not be parsed with an XML parser.
â Kusalananda
Feb 9 at 11:30
2
2
The XML is faulty. It has no root node and
<PhoneMobileList> has no end tag. This can not be parsed with an XML parser.â Kusalananda
Feb 9 at 11:30
The XML is faulty. It has no root node and
<PhoneMobileList> has no end tag. This can not be parsed with an XML parser.â Kusalananda
Feb 9 at 11:30
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
3
down vote
Assuming the following (modified) XML:
<?xml version="1.0"?>
<root>
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
</root>
The XMLStarlet
invocation
xml sel -t -m '//ContactPerson' -v 'concat(GivenName, " ", FamilyName, " ", PhoneFixList/PhoneFix, " ", EmailList/Email)' -nl file.xml
produces
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
The invocation of XMLStarlet contains an implicit loop over all ContactPerson nodes, and for each of these, the specific fields are concatenated to produce the correct output. The -nl at the end causes a newline to be printed.
Thank you Kusalananda. Is there any form to get the result without the xmlstarlet?
â lendoiro
Feb 9 at 11:51
1
@lendoiro XMLStarlet in the command line XML parser that I know best. You could possibly do it by means ofsedand/orawkas well, but these are generally not good tools for parsing XML, and I will not write an answer using them.
â Kusalananda
Feb 9 at 12:05
Ok. I was triying withsedand/orawkbut I couldn't resolve it. Thank you for your reply
â lendoiro
Feb 9 at 12:08
1
Don't even try to process XML with tools that don't understand XML.
â user32929
Feb 9 at 13:04
That last comment was probably for you @lendorio. I'm well aware of the issues with parsing XML using anything other than an XML parser.
â Kusalananda
Feb 9 at 13:32
add a comment |Â
up vote
1
down vote
With xml2 (and a shell with support for the $'...' quotes):
echo "<r>"; cat file.xml; echo "</r>"; |
| xml2 | 2csv -d $'t' ContactPerson GivenName FamilyName EmailList/Email
(for ContactPersons with more than one email address, the last one is returned)
add a comment |Â
up vote
1
down vote
If you're OK with having a second file for processing this, you can make an XSLT file and use it to transform your XML file using xsltproc.
phones.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="ContactPerson">
<xsl:value-of select="GivenName"/><xsl:text> </xsl:text><xsl:value-of select="FamilyName"/>
<xsl:for-each select="PhoneFixList/PhoneFix">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:for-each select="EmailList/Email">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Then transform the file (using @Kusalananda's XML as phones.xml):
$ xsltproc phones.xsl phones.xml
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
Using XSLT has the advantage that you can loop through repeating elements, do conditional output and so forth. If you're comfortable with a bit of study and programming, it's very powerful.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Assuming the following (modified) XML:
<?xml version="1.0"?>
<root>
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
</root>
The XMLStarlet
invocation
xml sel -t -m '//ContactPerson' -v 'concat(GivenName, " ", FamilyName, " ", PhoneFixList/PhoneFix, " ", EmailList/Email)' -nl file.xml
produces
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
The invocation of XMLStarlet contains an implicit loop over all ContactPerson nodes, and for each of these, the specific fields are concatenated to produce the correct output. The -nl at the end causes a newline to be printed.
Thank you Kusalananda. Is there any form to get the result without the xmlstarlet?
â lendoiro
Feb 9 at 11:51
1
@lendoiro XMLStarlet in the command line XML parser that I know best. You could possibly do it by means ofsedand/orawkas well, but these are generally not good tools for parsing XML, and I will not write an answer using them.
â Kusalananda
Feb 9 at 12:05
Ok. I was triying withsedand/orawkbut I couldn't resolve it. Thank you for your reply
â lendoiro
Feb 9 at 12:08
1
Don't even try to process XML with tools that don't understand XML.
â user32929
Feb 9 at 13:04
That last comment was probably for you @lendorio. I'm well aware of the issues with parsing XML using anything other than an XML parser.
â Kusalananda
Feb 9 at 13:32
add a comment |Â
up vote
3
down vote
Assuming the following (modified) XML:
<?xml version="1.0"?>
<root>
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
</root>
The XMLStarlet
invocation
xml sel -t -m '//ContactPerson' -v 'concat(GivenName, " ", FamilyName, " ", PhoneFixList/PhoneFix, " ", EmailList/Email)' -nl file.xml
produces
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
The invocation of XMLStarlet contains an implicit loop over all ContactPerson nodes, and for each of these, the specific fields are concatenated to produce the correct output. The -nl at the end causes a newline to be printed.
Thank you Kusalananda. Is there any form to get the result without the xmlstarlet?
â lendoiro
Feb 9 at 11:51
1
@lendoiro XMLStarlet in the command line XML parser that I know best. You could possibly do it by means ofsedand/orawkas well, but these are generally not good tools for parsing XML, and I will not write an answer using them.
â Kusalananda
Feb 9 at 12:05
Ok. I was triying withsedand/orawkbut I couldn't resolve it. Thank you for your reply
â lendoiro
Feb 9 at 12:08
1
Don't even try to process XML with tools that don't understand XML.
â user32929
Feb 9 at 13:04
That last comment was probably for you @lendorio. I'm well aware of the issues with parsing XML using anything other than an XML parser.
â Kusalananda
Feb 9 at 13:32
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Assuming the following (modified) XML:
<?xml version="1.0"?>
<root>
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
</root>
The XMLStarlet
invocation
xml sel -t -m '//ContactPerson' -v 'concat(GivenName, " ", FamilyName, " ", PhoneFixList/PhoneFix, " ", EmailList/Email)' -nl file.xml
produces
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
The invocation of XMLStarlet contains an implicit loop over all ContactPerson nodes, and for each of these, the specific fields are concatenated to produce the correct output. The -nl at the end causes a newline to be printed.
Assuming the following (modified) XML:
<?xml version="1.0"?>
<root>
<ContactPerson>
<GivenName>John</GivenName>
<FamilyName>Wayne</FamilyName>
<PhoneFixList>
<PhoneFix>78787878</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>john.wayne@gmail.com</Email>
</EmailList>
</ContactPerson>
<ContactPerson>
<GivenName>James</GivenName>
<FamilyName>Stewart</FamilyName>
<PhoneFixList>
<PhoneFix>90909090</PhoneFix>
</PhoneFixList>
<EmailList>
<Email>james.stewart@gmail.com</Email>
</EmailList>
</ContactPerson>
</root>
The XMLStarlet
invocation
xml sel -t -m '//ContactPerson' -v 'concat(GivenName, " ", FamilyName, " ", PhoneFixList/PhoneFix, " ", EmailList/Email)' -nl file.xml
produces
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
The invocation of XMLStarlet contains an implicit loop over all ContactPerson nodes, and for each of these, the specific fields are concatenated to produce the correct output. The -nl at the end causes a newline to be printed.
edited Feb 9 at 11:49
answered Feb 9 at 11:35
Kusalananda
103k13202318
103k13202318
Thank you Kusalananda. Is there any form to get the result without the xmlstarlet?
â lendoiro
Feb 9 at 11:51
1
@lendoiro XMLStarlet in the command line XML parser that I know best. You could possibly do it by means ofsedand/orawkas well, but these are generally not good tools for parsing XML, and I will not write an answer using them.
â Kusalananda
Feb 9 at 12:05
Ok. I was triying withsedand/orawkbut I couldn't resolve it. Thank you for your reply
â lendoiro
Feb 9 at 12:08
1
Don't even try to process XML with tools that don't understand XML.
â user32929
Feb 9 at 13:04
That last comment was probably for you @lendorio. I'm well aware of the issues with parsing XML using anything other than an XML parser.
â Kusalananda
Feb 9 at 13:32
add a comment |Â
Thank you Kusalananda. Is there any form to get the result without the xmlstarlet?
â lendoiro
Feb 9 at 11:51
1
@lendoiro XMLStarlet in the command line XML parser that I know best. You could possibly do it by means ofsedand/orawkas well, but these are generally not good tools for parsing XML, and I will not write an answer using them.
â Kusalananda
Feb 9 at 12:05
Ok. I was triying withsedand/orawkbut I couldn't resolve it. Thank you for your reply
â lendoiro
Feb 9 at 12:08
1
Don't even try to process XML with tools that don't understand XML.
â user32929
Feb 9 at 13:04
That last comment was probably for you @lendorio. I'm well aware of the issues with parsing XML using anything other than an XML parser.
â Kusalananda
Feb 9 at 13:32
Thank you Kusalananda. Is there any form to get the result without the xmlstarlet?
â lendoiro
Feb 9 at 11:51
Thank you Kusalananda. Is there any form to get the result without the xmlstarlet?
â lendoiro
Feb 9 at 11:51
1
1
@lendoiro XMLStarlet in the command line XML parser that I know best. You could possibly do it by means of
sed and/or awk as well, but these are generally not good tools for parsing XML, and I will not write an answer using them.â Kusalananda
Feb 9 at 12:05
@lendoiro XMLStarlet in the command line XML parser that I know best. You could possibly do it by means of
sed and/or awk as well, but these are generally not good tools for parsing XML, and I will not write an answer using them.â Kusalananda
Feb 9 at 12:05
Ok. I was triying with
sed and/or awk but I couldn't resolve it. Thank you for your replyâ lendoiro
Feb 9 at 12:08
Ok. I was triying with
sed and/or awk but I couldn't resolve it. Thank you for your replyâ lendoiro
Feb 9 at 12:08
1
1
Don't even try to process XML with tools that don't understand XML.
â user32929
Feb 9 at 13:04
Don't even try to process XML with tools that don't understand XML.
â user32929
Feb 9 at 13:04
That last comment was probably for you @lendorio. I'm well aware of the issues with parsing XML using anything other than an XML parser.
â Kusalananda
Feb 9 at 13:32
That last comment was probably for you @lendorio. I'm well aware of the issues with parsing XML using anything other than an XML parser.
â Kusalananda
Feb 9 at 13:32
add a comment |Â
up vote
1
down vote
With xml2 (and a shell with support for the $'...' quotes):
echo "<r>"; cat file.xml; echo "</r>"; |
| xml2 | 2csv -d $'t' ContactPerson GivenName FamilyName EmailList/Email
(for ContactPersons with more than one email address, the last one is returned)
add a comment |Â
up vote
1
down vote
With xml2 (and a shell with support for the $'...' quotes):
echo "<r>"; cat file.xml; echo "</r>"; |
| xml2 | 2csv -d $'t' ContactPerson GivenName FamilyName EmailList/Email
(for ContactPersons with more than one email address, the last one is returned)
add a comment |Â
up vote
1
down vote
up vote
1
down vote
With xml2 (and a shell with support for the $'...' quotes):
echo "<r>"; cat file.xml; echo "</r>"; |
| xml2 | 2csv -d $'t' ContactPerson GivenName FamilyName EmailList/Email
(for ContactPersons with more than one email address, the last one is returned)
With xml2 (and a shell with support for the $'...' quotes):
echo "<r>"; cat file.xml; echo "</r>"; |
| xml2 | 2csv -d $'t' ContactPerson GivenName FamilyName EmailList/Email
(for ContactPersons with more than one email address, the last one is returned)
answered Feb 9 at 12:53
Stéphane Chazelas
281k53516847
281k53516847
add a comment |Â
add a comment |Â
up vote
1
down vote
If you're OK with having a second file for processing this, you can make an XSLT file and use it to transform your XML file using xsltproc.
phones.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="ContactPerson">
<xsl:value-of select="GivenName"/><xsl:text> </xsl:text><xsl:value-of select="FamilyName"/>
<xsl:for-each select="PhoneFixList/PhoneFix">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:for-each select="EmailList/Email">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Then transform the file (using @Kusalananda's XML as phones.xml):
$ xsltproc phones.xsl phones.xml
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
Using XSLT has the advantage that you can loop through repeating elements, do conditional output and so forth. If you're comfortable with a bit of study and programming, it's very powerful.
add a comment |Â
up vote
1
down vote
If you're OK with having a second file for processing this, you can make an XSLT file and use it to transform your XML file using xsltproc.
phones.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="ContactPerson">
<xsl:value-of select="GivenName"/><xsl:text> </xsl:text><xsl:value-of select="FamilyName"/>
<xsl:for-each select="PhoneFixList/PhoneFix">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:for-each select="EmailList/Email">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Then transform the file (using @Kusalananda's XML as phones.xml):
$ xsltproc phones.xsl phones.xml
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
Using XSLT has the advantage that you can loop through repeating elements, do conditional output and so forth. If you're comfortable with a bit of study and programming, it's very powerful.
add a comment |Â
up vote
1
down vote
up vote
1
down vote
If you're OK with having a second file for processing this, you can make an XSLT file and use it to transform your XML file using xsltproc.
phones.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="ContactPerson">
<xsl:value-of select="GivenName"/><xsl:text> </xsl:text><xsl:value-of select="FamilyName"/>
<xsl:for-each select="PhoneFixList/PhoneFix">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:for-each select="EmailList/Email">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Then transform the file (using @Kusalananda's XML as phones.xml):
$ xsltproc phones.xsl phones.xml
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
Using XSLT has the advantage that you can loop through repeating elements, do conditional output and so forth. If you're comfortable with a bit of study and programming, it's very powerful.
If you're OK with having a second file for processing this, you can make an XSLT file and use it to transform your XML file using xsltproc.
phones.xsl:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:strip-space elements="*"/>
<xsl:template match="ContactPerson">
<xsl:value-of select="GivenName"/><xsl:text> </xsl:text><xsl:value-of select="FamilyName"/>
<xsl:for-each select="PhoneFixList/PhoneFix">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:for-each select="EmailList/Email">
<xsl:text> </xsl:text><xsl:value-of select="."/>
</xsl:for-each>
<xsl:text>
</xsl:text>
</xsl:template>
</xsl:stylesheet>
Then transform the file (using @Kusalananda's XML as phones.xml):
$ xsltproc phones.xsl phones.xml
John Wayne 78787878 john.wayne@gmail.com
James Stewart 90909090 james.stewart@gmail.com
Using XSLT has the advantage that you can loop through repeating elements, do conditional output and so forth. If you're comfortable with a bit of study and programming, it's very powerful.
answered Feb 9 at 20:57
ErikF
2,7111413
2,7111413
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f423013%2fparse-xml-file-in-a-specific-way%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2
The XML is faulty. It has no root node and
<PhoneMobileList>has no end tag. This can not be parsed with an XML parser.â Kusalananda
Feb 9 at 11:30