I have an xml with the following structure
<?xml version="1.0" encoding="UTF-8"?>
<MYXML>
<?source-system-command name="abc"?>
<NAME></NAME>
<REQUEST>request</REQUEST>
</MYXML>
I want to get the REQUEST TAG Extracted out - the Xquery is /MYXML/REQUEST
and I get <Request></Request>
Tag
However, now I want the REQUEST tag to be stripped off the MYXML
so the output i am looking for is
<?xml version="1.0" encoding="UTF-8"?>
<MYXML>
<?source-system-command name="abc"?>
<NAME></NAME> >!-- NO REQUEST -->
</MYXML>
I wrote the following XQUERY - "/MYXML/*[not(self::REQUEST)]"
but this filtersthe processing instruction <?source-system-command name="abc"?>
What am i missing ? How to tell the XQUERY Not to filter out processing instruction ?
Using SAXON-HE 9