Question: I want to parse the value pattern from servers.xml using linux command.

condition 

1. the variable pattern must be valid meaning it should not be inside comments

```
<!--- comments  -->

```
2. if the variable is inside comments,parser should not return anything.

PFB the xml

```
<Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs"
prefix="localhost_access_log." suffix=".txt"
pattern="%h %t %m %U %q %s %b %D %{X-Forwarded-For}i " />

```

Answer: 
You look as if you're using protected keywords as column names (you shouldn't really do this).

Try escaping them with `

```
insert into hall_booking (
name,address,event_type,hallNo,arrival_time,
arrival_date,dep_time,dep_date,`identity`,
emailid,contact,total_members,`desc`,catering,service,decoration,other) 
values(
'$nm','$add','$typ','$roomno','$arrv',
'$arrivaldate','$departure','$dDate','$idt',
'$emailid','$cont','$desc','200','200','200','200')

```
I think you have not mentioned last value

```
   "INSERT INTO `hall_booking`(`name`,`address  ,`event_type`,`hallNo`,`arrival_time`,`arrival_date`,`dep_time`,`dep_date`,`IDENTITY`,`emailid`,`contact`,`total_members`,`DESC`,`catering`,`service`,`decoration`,`other`)
    VALUES('".$nm."',
           '".$add."',
           '".$typ."',
           '".$roomno."',
           '".$arrv."',
           '".$arrivaldate."',
           '".$departure."',
           '".$dDate."',
           '".$idt."',
           '".$emailid."',
           '".$cont."',
           '".$desc."',
           '200',
           '200',
           '200',
           '200',
           'Last Value')"

```