Adding Matching Tags using XML Refactoring
Posted: Wed Jun 05, 2019 7:57 pm
Greetings,
I need to add opening and closing "para" tags to the code shown in Example #1 which exists in many different ICN number variations and across many separate XML files. Example #2 shows the result I need OxygenXML to deliver with the opening and closing "para" tags correctly inserted:
EXAMPLE #1 – Missing opening and closing <para> tags:
EXAMPLE #2 – <para> tags correctly inserted:
The XML Refactoring dialog window shows seven operations for Elements. The one I am choosing to use is the "Insert Element" option which inserts a new element at a specific location. What is the correct data I need to insert into the fields shown below so I can get the result shown in Example #2 with opening and closing "para" tags correctly inserted?
XML Refactoring - Insert Element Dialog Window
Element
Local Name: ??????? (tried "para" and it did not work)
Namespace: ??????? (don't understand)
Location
XPath: ??????????? (tried "entry/para" and did not work)
For "Scope" I select "Current File".
For ""Filters" I checkmark "Restrict to know XML file types only.
Then when I select "PREVIEW" I get the message below:
"Could not find any resources that would be affected by this operation."
Additionally, how do I instruct OxygenXML to skip over all Example #2 scenarios already existing in any XML file? Where is the control for to set that up?
Lastly does this operation require one use code similar to what is shown below which I used to make global changes to attributes ? (Covered in previous post).
Any help I can get that will clarify for me how to make this kind of XML Refactoring operation work successfully will be greatly appreciated. Thank you.
I need to add opening and closing "para" tags to the code shown in Example #1 which exists in many different ICN number variations and across many separate XML files. Example #2 shows the result I need OxygenXML to deliver with the opening and closing "para" tags correctly inserted:
EXAMPLE #1 – Missing opening and closing <para> tags:
Code: Select all
<symbol id="ACQDS017" infoEntityIdent="ICN-XYZ-DE-A000202-L-04939-02028-A-01-1" />
Code: Select all
<para><symbol id="ACQDS019" infoEntityIdent="ICN-XYZ-DE-A000202-L-04939-02327-A-01-1" /></para>
XML Refactoring - Insert Element Dialog Window
Element
Local Name: ??????? (tried "para" and it did not work)
Namespace: ??????? (don't understand)
Location
XPath: ??????????? (tried "entry/para" and did not work)
For "Scope" I select "Current File".
For ""Filters" I checkmark "Restrict to know XML file types only.
Then when I select "PREVIEW" I get the message below:
"Could not find any resources that would be affected by this operation."
Additionally, how do I instruct OxygenXML to skip over all Example #2 scenarios already existing in any XML file? Where is the control for to set that up?
Lastly does this operation require one use code similar to what is shown below which I used to make global changes to attributes ? (Covered in previous post).
Code: Select all
Find with (.*)[^*]$
Replace with $1*
OR
Find with (.*)([^*])$
Replace with $1$2*