G
Guest
Hello,
I am stuck trying to apply the following logic to the below xml:
<?xml version='1.0' encoding='ISO-8859-1'?>
<Collection>
<Book Id='1' Locator='Yes'>
<Title>Principle of Relativity</Title>
<Author>Albert Einstein</Author>
<Genre>Physics</Genre>
</Book>
<Book Id='2'>
<Title>Cosmos</Title>
<Author>Carl Sagan</Author>
<Genre>Cosmology</Genre>
</Book>
</Collection>
Read the "Locator" attribute from the Book element, in case it is "Yes"
.....delete the entire book element, so that the o/p now looks like:
<?xml version='1.0' encoding='ISO-8859-1'?>
<Collection>
<Book Id='2'>
<Title>Cosmos</Title>
<Author>Carl Sagan</Author>
<Genre>Cosmology</Genre>
</Book>
</Collection>
It would be very helpful if somebody can provide a little code on how to
achieve this?
Thanks.
I am stuck trying to apply the following logic to the below xml:
<?xml version='1.0' encoding='ISO-8859-1'?>
<Collection>
<Book Id='1' Locator='Yes'>
<Title>Principle of Relativity</Title>
<Author>Albert Einstein</Author>
<Genre>Physics</Genre>
</Book>
<Book Id='2'>
<Title>Cosmos</Title>
<Author>Carl Sagan</Author>
<Genre>Cosmology</Genre>
</Book>
</Collection>
Read the "Locator" attribute from the Book element, in case it is "Yes"
.....delete the entire book element, so that the o/p now looks like:
<?xml version='1.0' encoding='ISO-8859-1'?>
<Collection>
<Book Id='2'>
<Title>Cosmos</Title>
<Author>Carl Sagan</Author>
<Genre>Cosmology</Genre>
</Book>
</Collection>
It would be very helpful if somebody can provide a little code on how to
achieve this?
Thanks.