I have an XML file as shown below:
<headerRule name='modifyCType'
headerName='Content-Type'
action='manipulate'
matchValue='($checkPT18.$chkPT18)&!$checkAnnexb.$chkAnnexb)'
newValue='<'
methods='INVITE'>
</headerRule>
While unmarshalling using JAXB, it says invalid character &
on matchValue='($checkPT18.$chkPT18)&!$checkAnnexb.$chkAnnexb)'
which I replaced with &
and it is working now i.e. matchValue='($checkPT18.$chkPT18)&!$checkAnnexb.$chkAnnexb)'
.
However, there is another invalid character <
on newValue='<'
when I replace it with <
it works fine however it replaces all '<' character with <
including <headerRule
as shown below:
<headerRule name='modifyCType'
headerName='Content-Type'
action='manipulate'
matchValue='($checkPT18.$chkPT18)&!$checkAnnexb.$chkAnnexb)'
newValue='<'
methods='INVITE'>
</headerRule>
which I do not want. I want:
<headerRule name='modifyCType'
headerName='Content-Type'
action='manipulate'
matchValue='($checkPT18.$chkPT18)&!$checkAnnexb.$chkAnnexb)'
newValue='<'
methods='INVITE'>
</headerRule>
How to replace < with < only for attribute value i.e. newValue using jaxb parsing?