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: 
```
Try this:
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')"

```
You are getting this error because you are using a reserved keyword `desc` as a column name. To overcome this error you can replace your query with the following one:

```
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')"

```

Also you can refer this article for more clarification:

[How do I escape reserved words used as column names? MySQL/Create Table](https://stackoverflow.com/questions/2889871/how-do-i-escape-reserved-words-used-as-column-names-mysql-create-table)