How to find missing element from a XML
-
I have an XML(Group of 100+ strings) with a missing Schema Element “<OrderingClinician>” which used to come in between two Schema Element “<Net>” & “<Clinician>”.
How to find the Missing Schema Element from an XML in Notpad++?
-
<Net>Seomthing</Net> <Clinician>Something</Clinician> <Net>Here</Net> <OrderingClinician>There</OrderingClinician> <Clinician>Everywhere</Clinician>
- FIND =
(?s)</Net>\K((?!<OrderingClinician).)*?(?=(\s*)<Clinician>)
- REPLACE =
$1$2<OrderingClinician>Was Missing</OrderingClinician>
- SEARCH MODE = regular expression
<Net>Seomthing</Net> <OrderingClinician>Was Missing</OrderingClinician> <Clinician>Something</Clinician> <Net>Here</Net> <OrderingClinician>There</OrderingClinician> <Clinician>Everywhere</Clinician>
This will insert the OrderingClinician between the Net and Clinician if it’s missing, and indent the same amount as the Clinician.
----
Useful References
- FIND =