<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Replace xml tagging]]></title><description><![CDATA[<p dir="auto">Hello.  Please pardon mistakes here as this is my first post.<br />
I have an XML based technical manual with hundreds of work packages (xml files).<br />
Inside many of these files, there are “link” tagging structures that need to be replaced with “xref” construct.  The references in the link’s are valid and need to be transferred into the xref structure.<br />
For example:<br />
&lt;link linkaction=“immediate” linktype=“return” xlink:href=“IETM://S50005#S50005-TOOL1”<br />
xreftype=“table”&gt;<br />
&lt;prompt&gt;Multimeter&lt;/prompt&gt;<br />
&lt;/link&gt;</p>
<p dir="auto">needs to be replaced with:<br />
&lt;xref itemid=“S50005-TOOL1” wpid=“S50005”/&gt;</p>
<p dir="auto">I did get what appears to be an XSLT based solution, but I’m not sure how to use it.<br />
Here is that solution:</p>
<p dir="auto">Here is XSLT based solution. Notepad++ has XML Tools plugin for that.<br />
To make input XML well-formed, I had to add a namespace to the root tag.<br />
Input XML</p>
<p dir="auto">&lt;?xml version=“1.0”?&gt;<br />
&lt;root xmlns:xlink=“URI”&gt;<br />
&lt;link linkaction=“immediate” linktype=“return”<br />
xlink:href=“IETM://S50005#S50005-TOOL1” xreftype=“table”&gt;<br />
&lt;prompt&gt;Multimeter&lt;/prompt&gt;<br />
&lt;/link&gt;<br />
&lt;link linkaction=“immediate” linktype=“return”<br />
xlink:href=“IETM://S50005#S50018-TOOL15” xreftype=“table”&gt;<br />
&lt;prompt&gt;Multimeter&lt;/prompt&gt;<br />
&lt;/link&gt;<br />
&lt;/root&gt;<br />
XSLT</p>
<p dir="auto">&lt;?xml version=“1.0”?&gt;<br />
&lt;xsl:stylesheet version=“1.0” xmlns:xsl=“<a href="http://www.w3.org/1999/XSL/Transform" rel="nofollow ugc">http://www.w3.org/1999/XSL/Transform</a>” xmlns:xlink=“URI”&gt;<br />
&lt;xsl:output method=“xml” encoding=“utf-8” indent=“yes” omit-xml-declaration=“yes”/&gt;<br />
&lt;xsl:strip-space elements=“*”/&gt;</p>
<pre><code>&lt;xsl:template match="@*|node()"&gt;
    &lt;xsl:copy&gt;
        &lt;xsl:apply-templates select="@*|node()"/&gt;
    &lt;/xsl:copy&gt;
&lt;/xsl:template&gt;

&lt;xsl:template match="link"&gt;
    &lt;xref itemid="{substring-after(@xlink:href, '#')}" wpid="{substring-before(substring-after(@xlink:href, '#'),'-')}"/&gt;
&lt;/xsl:template&gt;
</code></pre>
<p dir="auto">&lt;/xsl:stylesheet&gt;<br />
Output</p>
<p dir="auto">&lt;root xmlns:xlink=“URI”&gt;<br />
&lt;xref itemid=“S50005-TOOL1” wpid=“S50005” /&gt;<br />
&lt;xref itemid=“S50018-TOOL15” wpid=“S50018” /&gt;<br />
&lt;/root&gt;</p>
<p dir="auto">Now, that output does look good.<br />
Is it possible to do a simple Search, Find in Files, Find/Replace?</p>
<p dir="auto">Here are my system details:<br />
Notepad++ v8.1.5   (64-bit)<br />
Build time : Sep 26 2021 - 15:23:23<br />
Path : C:\Program Files\Notepad++\notepad++.exe<br />
Command Line :<br />
Admin mode : OFF<br />
Local Conf mode : OFF<br />
Cloud Config : OFF<br />
OS Name : Windows 10 Pro for Workstations (64-bit)<br />
OS Version : 2009<br />
OS Build : 19042.1237<br />
Current ANSI codepage : 1252<br />
Plugins : ComparePlugin.dll mimeTools.dll NppConverter.dll NppExport.dll XMLTools.dll</p>
]]></description><link>https://community.notepad-plus-plus.org/topic/21967/replace-xml-tagging</link><generator>RSS for Node</generator><lastBuildDate>Wed, 20 May 2026 16:38:47 GMT</lastBuildDate><atom:link href="https://community.notepad-plus-plus.org/topic/21967.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 13 Oct 2021 16:31:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Replace xml tagging on Fri, 15 Oct 2021 14:36:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: Richard-Howard">@<bdi>Richard-Howard</bdi></a></p>
<blockquote>
<p dir="auto">I’m starting to get the hang of it ( I hope :) ).</p>
</blockquote>
<p dir="auto"><img src="/assets/uploads/files/1634308413960-8c6c8f1b-419f-442f-be6e-48912be41cc0-image.png" alt="8c6c8f1b-419f-442f-be6e-48912be41cc0-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">It worked. Good job. :-)</p>
<p dir="auto">And a note: one of the things I like about this site, compared to certain stack-based exchange forums, is that this site doesn’t limit you to “one right answer”; many times, there are multiple posts in a discussion that help lead to a final answer, and I like being able to reward them all.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70513</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70513</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 15 Oct 2021 14:36:11 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Fri, 15 Oct 2021 14:34:59 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a><br />
Thanks Peter.  I’m starting to get the hang of it ( I hope <code>:)</code> ).</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70512</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70512</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Fri, 15 Oct 2021 14:34:59 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Fri, 15 Oct 2021 14:32:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: Richard-Howard">@<bdi>Richard-Howard</bdi></a> said in <a href="/post/70510">Replace xml tagging</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: Richard-Howard">@<bdi>Richard-Howard</bdi></a><br />
Guy, I’d like to credit your contribution.  Is there a mechanism for that?<br />
You helped me save hours in conversion time!</p>
</blockquote>
<p dir="auto">Clicking the little ^ by each post will “upvote” the post, giving the author of that post an extra “reputation point”.<br />
<img src="/assets/uploads/files/1634308114952-672a34f4-93c3-4f56-8e97-153229ea9601-image.png" alt="672a34f4-93c3-4f56-8e97-153229ea9601-image.png" class=" img-fluid img-markdown" /></p>
<p dir="auto">Other than that, there’s no other “credit” mechanism or “report outstanding help” in the forum.</p>
<p dir="auto">But being polite and saying “thank you” (as you have done) <em>are</em> appreciated – probably more than upvotes. :-)  (At least, that’s true for me, and I assume for <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>  as well.)</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70511</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70511</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Fri, 15 Oct 2021 14:32:04 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Fri, 15 Oct 2021 14:10:24 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: Richard-Howard">@<bdi>Richard-Howard</bdi></a><br />
Guy, I’d like to credit your contribution.  Is there a mechanism for that?<br />
You helped me save hours in conversion time!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70510</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70510</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Fri, 15 Oct 2021 14:10:24 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Thu, 14 Oct 2021 20:01:18 GMT]]></title><description><![CDATA[<p dir="auto">Hello <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a><br />
Despite my stumbling around here and providing you with less than perfect info to work with, I believe you have my issue resolved!  This latest edition does seem to be working universally!  You have been such a tremendous help.  It is so appreciated.  And Peter, I do thank you for pointing me in a better direction.  Is there a proper way for me to report such outstanding help?<br />
Thanks again.<br />
Richard</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70496</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70496</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Thu, 14 Oct 2021 20:01:18 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Thu, 14 Oct 2021 19:12:49 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: richard-howard">@<bdi>richard-howard</bdi></a>, <a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: peterjones">@<bdi>peterjones</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">First, <strong>thanks</strong> for providing your <em>INPUT</em> text in a <strong>raw</strong> form ! However, at the <strong>same</strong> time, you should have provided your <strong>expected</strong> <em>OUTPUT</em> text which is :</p>
<pre><code class="language-xml">&lt;testeqp&gt;
&lt;testeqp-setup-item&gt;&lt;name&gt;A/B Interface Cable Qty: 4&lt;/name&gt;&lt;itemref&gt;
&lt;xref itemid="S60005-TOOL74" wpid="S60005" /&gt;&lt;/itemref&gt;&lt;/testeqp-setup-item&gt;
&lt;testeqp-setup-item&gt;&lt;name&gt;Adapter TDCU J1 (Bradley A3 # 2)&lt;/name&gt;
&lt;itemref&gt;&lt;xref itemid="S6A002-coeiitem40" wpid="S60002" /&gt;&lt;/itemref&gt;
&lt;/testeqp-setup-item&gt;
&lt;testeqp-setup-item&gt;&lt;name&gt;BRM Personality Adapter &lt;/name&gt;&lt;itemref&gt;&lt;xref itemid="S60005-TOOL2" wpid="S60005" /&gt;&lt;/itemref&gt;&lt;/testeqp-setup-item&gt;
&lt;testeqp-setup-item&gt;&lt;name&gt;Interconnect Device ICD No. 1&lt;/name&gt;&lt;itemref&gt;
&lt;xref itemid="S60005-TOOL10" wpid="S60005" /&gt;&lt;/itemref&gt;
&lt;/testeqp-setup-item&gt;
</code></pre>
<p dir="auto">Isn’t it ?</p>
<hr />
<p dir="auto">Of course, I slightly modified the <strong>regex</strong> S/R, replacing a <strong>single literal</strong> space char by the expression <strong><code>\s+</code></strong> which matches any <strong>non-null</strong> range of <strong>consecutive blank</strong> characters ( either <strong><code>\x20</code></strong>, <strong><code>\t</code></strong>, <strong><code>\xA0</code></strong>, <strong><code>\r</code></strong>, <strong><code>\n</code></strong>, <strong><code>\x0B</code></strong> <strong><code>\f</code></strong> and <strong>few</strong> others )</p>
<p dir="auto">So my <strong>last</strong> version is :</p>
<p dir="auto">SEARCH <strong><code>(?-i)&lt;link\s+(?s:.+?)//(?-s)(.+)#(.+?)"(?s:.+?)&lt;/link&gt;</code></strong></p>
<p dir="auto">REPLACE <strong><code>&lt;xref itemid="\2" wpid="\1" /&gt;</code></strong></p>
<hr />
<p dir="auto">If you want, in addition, to <strong>isolate</strong> the part replaced ( <strong><code>&lt;xref itemid="•••••••••" wpid="•••••" /&gt;</code></strong> ), in a <strong>single</strong> line, change the <em>REPLACE</em> regex with :</p>
<p dir="auto">REPLACE <strong><code>\r\n&lt;xref itemid="\2" wpid="\1" /&gt;\r\n</code></strong>    ( or <strong><code>\n&lt;xref itemid="\2" wpid="\1" /&gt;\n</code></strong> if you work on <strong>Unix</strong> files )</p>
<p dir="auto">If you expect any <strong>other</strong> <em>OUTPUT</em> displaying, just tell me !</p>
<p dir="auto">BR</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70494</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70494</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 14 Oct 2021 19:12:49 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Thu, 14 Oct 2021 15:52:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: Richard-Howard">@<bdi>Richard-Howard</bdi></a><br />
Ok  - using the Code insert, here is the code sample I am wanting to show.</p>
<pre><code>&lt;testeqp&gt;
&lt;testeqp-setup-item&gt;&lt;name&gt;A/B Interface Cable Qty: 4&lt;/name&gt;&lt;itemref&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S60005#S60005-TOOL74" xreftype="table"&gt;&lt;prompt
&gt;A/B Interface Cable&lt;/prompt&gt;&lt;/link&gt;&lt;/itemref&gt;&lt;/testeqp-setup-item&gt;
&lt;testeqp-setup-item&gt;&lt;name&gt;Adapter TDCU J1 (Bradley A3 # 2)&lt;/name&gt;
&lt;itemref&gt;&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S60002#S6A002-coeiitem40" xreftype="table"&gt;&lt;prompt
&gt;Adapter TDCU J1 (Bradley A3 # 2) &lt;/prompt&gt;&lt;/link&gt;&lt;/itemref&gt;
&lt;/testeqp-setup-item&gt;
&lt;testeqp-setup-item&gt;&lt;name&gt;BRM Personality Adapter &lt;/name&gt;&lt;itemref&gt;&lt;link
linkaction="immediate" linktype="return"
xlink:href="IETM://S60005#S60005-TOOL2" xreftype="table"&gt;&lt;prompt&gt;BRM
Personality Adapter &lt;/prompt&gt;&lt;/link&gt;&lt;/itemref&gt;&lt;/testeqp-setup-item&gt;
&lt;testeqp-setup-item&gt;&lt;name&gt;Interconnect Device ICD No. 1&lt;/name&gt;&lt;itemref&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S60005#S60005-TOOL10" xreftype="table"&gt;&lt;prompt
&gt;Interconnect Device ICD No. 1 &lt;/prompt&gt;&lt;/link&gt;&lt;/itemref&gt;
&lt;/testeqp-setup-item&gt;
</code></pre>
]]></description><link>https://community.notepad-plus-plus.org/post/70489</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70489</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Thu, 14 Oct 2021 15:52:43 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Thu, 14 Oct 2021 15:45:50 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/peterjones" aria-label="Profile: PeterJones">@<bdi>PeterJones</bdi></a><br />
Hello Peter.  Thank you for that helpful advise.  I’ll take a look at the Formatting Forum Posts and try to do a better job.<br />
Sounds like Guy is really going over and above in trying to help me.  I appreciate all of the help.</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70488</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70488</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Thu, 14 Oct 2021 15:45:50 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Thu, 14 Oct 2021 15:40:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: Richard-Howard">@<bdi>Richard-Howard</bdi></a> said in <a href="/post/70486">Replace xml tagging</a>:</p>
<blockquote>
<p dir="auto">As you can see, the text is not lined up consistently.</p>
</blockquote>
<p dir="auto">FYI, we cannot see that.  <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> has been doing an excellent job of guessing your meaning, but you have not been using the instructions for <a href="https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts">Formatting Forum Posts</a>, which are linked in the <a href="https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts">Please Read Before Posting</a> post in the top of this <strong>Help wanted</strong> section of the forum – and this makes some aspects of the data, like leading spaces or other certain characters, not visible by us.  On the other hand, <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>’s posts have been using this formatting advice, which makes his replies to you really easy to understand, so that you know exactly what data he is using, and can see the regexes stand out in <code>red text</code>, and any indenting or special characters come through correctly.  If you were to follow this formatting advice, it would be much easier for us all (including <a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a>) to know what your data really is.</p>
<p dir="auto">-—</p>
<p dir="auto"><em>Do you want regex search/replace help?  Then please be patient and polite, show some effort, and be willing to learn; answer questions and requests for clarification that are made of you.  All example text should be marked as literal text using the <code>&lt;/&gt;</code> toolbar button or manual <a href="https://community.notepad-plus-plus.org/topic/21925/faq-desk-formatting-forum-posts">formatting commands</a>.</em></p>
<p dir="auto"><em>To make <code>regex in red</code> (and so they keep their special characters like *), use backticks, like <code>`^.*?blah.*?\z`</code>. Screenshots can be pasted from the clipboard to your post using <code>Ctrl+V</code> to show graphical items, but any text should be included as literal text in your post so we can easily copy/paste your data.</em></p>
<p dir="auto"><em>Show the data you have <strong>and</strong> the text you want to get from that data; include examples of things that <strong>should match</strong> and be transformed, <strong>and</strong> things that <strong>don’t match</strong> and should be left alone; show <strong>edge cases</strong> and make sure you examples are as <strong>varied</strong> as your real data.  Show the regex you already tried, <strong>and why</strong> you thought it should work; tell us what’s wrong with what you <strong>do</strong> get.</em></p>
<p dir="auto"><em>Read the official <a href="https://npp-user-manual.org/docs/searching/#regular-expressions" rel="nofollow ugc">NPP Searching / Regex docs</a> and the forum’s <a href="https://community.notepad-plus-plus.org/topic/15765/faq-desk-where-to-find-regex-documentation">Regular Expression FAQ</a>. If you follow these guidelines, you’re much more likely to get helpful replies that solve your problem in the shortest number of tries.</em></p>
<p dir="auto"><img src="https://camo.nodebb.org/e4687162a6c7862b83614673105583531335560e?url=https%3A%2F%2Fi.imgur.com%2FKOsSLNe.png" alt="" class=" img-fluid img-markdown" /></p>
]]></description><link>https://community.notepad-plus-plus.org/post/70487</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70487</guid><dc:creator><![CDATA[PeterJones]]></dc:creator><pubDate>Thu, 14 Oct 2021 15:40:34 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Thu, 14 Oct 2021 15:24:54 GMT]]></title><description><![CDATA[<p dir="auto">Ok - I have had some success, but not always.<br />
Apparently it is dependent on the line structuring, which you have suggested earlier.<br />
When I adjusted the text to line up with your example, line-by-line, it works!<br />
The alignment is not always in this form however.<br />
Here is a block of code from one file.  As you can see, the text is not lined up consistently.<br />
In this case, the search criteria Does find three of these four.  It does not find the 3rd one, with the starting link tag at the end of the line.<br />
Any way to allow for this random type structuring?<br />
Progress!<br />
Thanks!!</p>
<p dir="auto">&lt;testeqp&gt;<br />
&lt;testeqp-setup-item&gt;&lt;name&gt;A/B Interface Cable Qty: 4&lt;/name&gt;&lt;itemref&gt;<br />
<strong>&lt;link</strong> linkaction=“immediate” linktype=“return”<br />
xlink:href=“IETM://S60005#S60005-TOOL74” xreftype=“table”&gt;&lt;prompt</p>
<blockquote>
<p dir="auto">A/B Interface Cable&lt;/prompt&gt;<strong>&lt;/link&gt;</strong>&lt;/itemref&gt;&lt;/testeqp-setup-item&gt;<br />
&lt;testeqp-setup-item&gt;&lt;name&gt;Adapter TDCU J1 (Bradley A3 # 2)&lt;/name&gt;<br />
&lt;itemref&gt;<strong>&lt;link</strong> linkaction=“immediate” linktype=“return”<br />
xlink:href=“IETM://S60002#S6A002-coeiitem40” xreftype=“table”&gt;&lt;prompt<br />
Adapter TDCU J1 (Bradley A3 # 2) &lt;/prompt&gt;<strong>&lt;/link&gt;</strong>&lt;/itemref&gt;<br />
&lt;/testeqp-setup-item&gt;<br />
&lt;testeqp-setup-item&gt;&lt;name&gt;BRM Personality Adapter &lt;/name&gt;&lt;itemref&gt;<strong>&lt;link</strong><br />
linkaction=“immediate” linktype=“return”<br />
xlink:href=“IETM://S60005#S60005-TOOL2” xreftype=“table”&gt;&lt;prompt&gt;BRM<br />
Personality Adapter &lt;/prompt&gt;<strong>&lt;/link&gt;</strong>&lt;/itemref&gt;&lt;/testeqp-setup-item&gt;<br />
&lt;testeqp-setup-item&gt;&lt;name&gt;Interconnect Device ICD No. 1&lt;/name&gt;&lt;itemref&gt;<br />
<strong>&lt;link</strong> linkaction=“immediate” linktype=“return”<br />
xlink:href=“IETM://S60005#S60005-TOOL10” xreftype=“table”&gt;&lt;prompt<br />
Interconnect Device ICD No. 1 &lt;/prompt&gt;<strong>&lt;/link&gt;</strong>&lt;/itemref&gt;<br />
&lt;/testeqp-setup-item&gt;</p>
</blockquote>
]]></description><link>https://community.notepad-plus-plus.org/post/70486</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70486</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Thu, 14 Oct 2021 15:24:54 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Thu, 14 Oct 2021 14:26:00 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: richard-howard">@<bdi>richard-howard</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">OK ! So, let’s try with this <em>INPUT</em> text, pasted in a <strong>new</strong> tab :</p>
<pre><code class="language-diff">&lt;?xml version="1.0"?&gt;
&lt;root xmlns:xlink="URI"&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50005#S50005-TOOL1" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50018#S50018-TOOL15" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50022#S50022-TOOL723" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50099#S50099-TOOL0" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;/root&gt;
</code></pre>
<p dir="auto">After using the following S/R :</p>
<p dir="auto">SEARCH <strong><code>(?-i)&lt;link (?s:.+?)//(?-s)(.+)#(.+?)"(?s:.+?)&lt;/link&gt;</code></strong></p>
<p dir="auto">REPLACE <strong><code>&lt;xref itemid="\2" wpid="\1" /&gt;</code></strong></p>
<p dir="auto">You should be left with this <em>OUTPUT</em> text :</p>
<pre><code class="language-diff">&lt;?xml version="1.0"?&gt;
&lt;root xmlns:xlink="URI"&gt;
&lt;xref itemid="S50005-TOOL1" wpid="S50005" /&gt;
&lt;xref itemid="S50018-TOOL15" wpid="S50018" /&gt;
&lt;xref itemid="S50022-TOOL723" wpid="S50022" /&gt;
&lt;xref itemid="S50099-TOOL0" wpid="S50099" /&gt;
&lt;/root&gt;
</code></pre>
<hr />
<p dir="auto">Do you obtain this result ? If <strong>yes</strong> but you <strong>still</strong> have some problems with your <strong>real</strong> text, this means that the general <strong>template</strong> of your file is <strong>slightly</strong> different from my example ;-))</p>
<p dir="auto">Cheers</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70482</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70482</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Thu, 14 Oct 2021 14:26:00 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Thu, 14 Oct 2021 13:20:04 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a> said in <a href="/post/70449">Replace xml tagging</a>:</p>
<blockquote>
<p dir="auto">(?-i)&lt;link (?s:.+?)//(?-s)(.+)#(.+?)"(?s:.+?)&lt;/link&gt;</p>
</blockquote>
<p dir="auto">Hello Guy,<br />
I believe the part IETM://*****#********** will always be on one line.<br />
I am still having trouble getting the Find/Replace to find the string.<br />
“Can’t find the text “(?-i)&lt;link (?s:.+?)//(?-s)(.+)#(.+?)”(?s:.+?)&lt;/link&gt;”"<br />
It’s like it’s looking for that literal string, instead of what the coding is intending it to find?<br />
Anyway, I sure appreciate your efforts!<br />
Maybe I"m doing something wrong?<br />
I do have Wrap Around and Regular Expression selected.<br />
Thanks,<br />
Richard</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70475</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70475</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Thu, 14 Oct 2021 13:20:04 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Wed, 13 Oct 2021 23:11:21 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: richard-howard">@<bdi>richard-howard</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Finally, after some thought, I realized that the <strong>new</strong> regex S/R does <strong>not</strong> care at all, about cases <strong><code>A</code></strong> or <strong><code>B</code></strong> as it just rewrites :</p>
<ul>
<li>
<p dir="auto">The part <strong>after</strong> the <strong><code>#</code></strong> char, as the <strong><code>item-id</code></strong> attribute, <strong>whatever</strong> its value</p>
</li>
<li>
<p dir="auto">The part <strong>before</strong> the <strong><code>#</code></strong> char as the <strong><code>wpid</code></strong> attribute, <strong>whatever</strong> its value</p>
</li>
</ul>
<hr />
<p dir="auto">So, here is this <strong>new</strong> S/R :</p>
<p dir="auto">SEARCH <strong><code>(?-i)&lt;link (?s:.+?)//(?-s)(.+)#(.+?)"(?s:.+?)&lt;/link&gt;</code></strong></p>
<p dir="auto">REPLACE <strong><code>&lt;xref itemid="\2" wpid="\1" /&gt;</code></strong>    ( Unchanged )</p>
<hr />
<p dir="auto">Nevertheless, note that I <strong>assume</strong> that the part <strong><code>IETM://•••••#••••••••••”</code></strong> is <strong>always</strong> written on a <strong>single</strong> line ! In the <strong>opposite</strong> case just tell me !</p>
<p dir="auto">Best Regards,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70449</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70449</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 13 Oct 2021 23:11:21 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Wed, 13 Oct 2021 21:54:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: Richard-Howard">@<bdi>Richard-Howard</bdi></a><br />
Or rather, the wpid is included in the itemid.<br />
Either way, it’s B.<br />
Thank you!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70446</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70446</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Wed, 13 Oct 2021 21:54:39 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Wed, 13 Oct 2021 21:53:51 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/guy038" aria-label="Profile: guy038">@<bdi>guy038</bdi></a><br />
Hey Guy,<br />
It is B.  The wpid is included in the Tool number.<br />
Thanks again!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70445</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70445</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Wed, 13 Oct 2021 21:53:51 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Wed, 13 Oct 2021 20:48:15 GMT]]></title><description><![CDATA[<p dir="auto">Hi, <a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: richard-howard">@<bdi>richard-howard</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">Ah… OK ! In my regex, I suppose that the line, beginning with <strong><code>&lt;link •••••</code></strong>  till the string <strong><code>xlink:href=“IETM://•••••#••••••••••”</code></strong> was on a <strong>single</strong> line !</p>
<p dir="auto">As it can be split in <strong>two</strong> lines, I found out the <strong>right</strong> solution. But before providing this <strong>new</strong> S/R, I need <strong>additional</strong> information !</p>
<hr />
<p dir="auto">Is your <em>INPUT</em> text like :</p>
<pre><code class="language-diff">&lt;?xml version="1.0"?&gt;
&lt;root xmlns:xlink="URI"&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50005#S50005-TOOL1" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50005#S50018-TOOL15" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50005#S50022-TOOL723" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50005#S50099-TOOL0" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;/root&gt;
</code></pre>
<p dir="auto">So, the string, between <strong><code>//</code></strong> and the <strong><code>#</code></strong> char, is <strong>always</strong> <strong><code>S50005</code></strong> and then the <em>OUTPUT</em> would be :</p>
<pre><code class="language-diff">&lt;root xmlns:xlink=“URI”&gt;
&lt;xref itemid=“S50005-TOOL1” wpid=“S50005” /&gt;
&lt;xref itemid=“S50018-TOOL15” wpid=“S50005” /&gt;
&lt;xref itemid=“S50022-TOOL723” wpid=“S50005” /&gt;
&lt;xref itemid=“S50099-TOOL0” wpid=“S50005” /&gt;
&lt;/root&gt;
</code></pre>
<p dir="auto"><em>OR</em> do you mean :</p>
<pre><code class="language-diff">&lt;?xml version="1.0"?&gt;
&lt;root xmlns:xlink="URI"&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50005#S50005-TOOL1" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50018#S50018-TOOL15" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50022#S50022-TOOL723" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;link linkaction="immediate" linktype="return"
xlink:href="IETM://S50099#S50099-TOOL0" xreftype="table"&gt;
&lt;prompt&gt;Multimeter&lt;/prompt&gt;
&lt;/link&gt;
&lt;/root&gt;
</code></pre>
<p dir="auto">And, in this case, the string, between <strong><code>//</code></strong> and the <strong><code>#</code></strong> char is just repeated <strong>right after</strong> the <strong><code>#</code></strong> character and, then, the <em>OUTPUT</em> would be :</p>
<pre><code class="language-diff">&lt;root xmlns:xlink=“URI”&gt;
&lt;xref itemid=“S50005-TOOL1” wpid=“S50005” /&gt;
&lt;xref itemid=“S50018-TOOL15” wpid=“S50018” /&gt;
&lt;xref itemid=“S50022-TOOL723” wpid=“S50022” /&gt;
&lt;xref itemid=“S50099-TOOL0” wpid=“S50099” /&gt;
&lt;/root&gt;
</code></pre>
<p dir="auto">Tell me which solution ( <strong><code>A</code></strong> or <strong><code>B</code></strong> ) is desired, or, may be, an <strong>other</strong> one !</p>
<p dir="auto">See you later</p>
<p dir="auto">Cheers,</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70440</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70440</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 13 Oct 2021 20:48:15 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Wed, 13 Oct 2021 18:01:28 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: Richard-Howard">@<bdi>Richard-Howard</bdi></a><br />
Hello Guy.  Thanks for that prompt response!<br />
Copied your Search and Replace strings into my Replace fields.<br />
It doesn’t find the &lt;link string.  “0 occurrences were replaced”<br />
I’ve loving the hope though!</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70438</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70438</guid><dc:creator><![CDATA[Richard Howard]]></dc:creator><pubDate>Wed, 13 Oct 2021 18:01:28 GMT</pubDate></item><item><title><![CDATA[Reply to Replace xml tagging on Wed, 13 Oct 2021 17:58:00 GMT]]></title><description><![CDATA[<p dir="auto">Hello, <a class="plugin-mentions-user plugin-mentions-a" href="/user/richard-howard" aria-label="Profile: richard-howard">@<bdi>richard-howard</bdi></a> and <strong>All</strong>,</p>
<p dir="auto">I think that you don’t even need the <strong><code>XSLT based</code></strong> solution. A <strong>regex</strong> S/R should be enough !</p>
<ul>
<li>
<p dir="auto">Open the <strong>Replace</strong> dialog ( <strong><code>Ctrl + H</code></strong> )</p>
<ul>
<li>
<p dir="auto">SEARCH <strong><code>(?-si)&lt;link .+//(.+)#(.+)"(?s:.+?)&lt;/link&gt;</code></strong></p>
</li>
<li>
<p dir="auto">REPLACE <strong><code>&lt;xref itemid="\2" wpid="\1" /&gt;</code></strong></p>
</li>
<li>
<p dir="auto">Tick the <strong><code>Wrap around</code></strong> option</p>
</li>
<li>
<p dir="auto">Select the <strong><code>Regular expression</code></strong> search mode</p>
</li>
<li>
<p dir="auto">Click on the <strong><code>Replace All</code></strong> button</p>
</li>
</ul>
</li>
<li>
<p dir="auto">Press the <strong><code>Esc</code></strong> key to close the <strong>Replace</strong> dialog</p>
</li>
</ul>
<p dir="auto">Voila !</p>
<p dir="auto">Best Regards</p>
<p dir="auto">guy038</p>
]]></description><link>https://community.notepad-plus-plus.org/post/70437</link><guid isPermaLink="true">https://community.notepad-plus-plus.org/post/70437</guid><dc:creator><![CDATA[guy038]]></dc:creator><pubDate>Wed, 13 Oct 2021 17:58:00 GMT</pubDate></item></channel></rss>