Applying xml:lang across every file in map

Is there a way to select a map and apply an xml:lang across every file in that map to the main topic type tag? Thanks! Matt AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire et peuvent contenir des informations confidentielles appartenant a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute lecture, divulgation, ou reproduction de ce message et des pieces jointes est strictement interdite. Si vous avez recu ce message par erreur merci d'en prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes. NOTICE: This message and attachments are intended only for the use of their addressee and may contain confidential information belonging to bioMerieux. If you are not the intended recipient, you are hereby notified that any reading, dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately and delete this message, along with any attachments.

Hello Matt, Unfortunately there is no XML specialized feature in Oxygen for setting an attribute for a set of files. We do have a feature request for this, but it has not been implemented yet. However, one workaround for this is to use the Find/Replace in Files with the appropriate regular expressions and filters on the DITA Map hierarchy. It's a text replacement tool, but it is XML-aware and it supports XPath filters. Steps: 1. First create (or make sure you have) a backup copy of your files (preferably the entire project), just in case anything goes wrong. 2. If you already have xml:lang set on the root element of some of the files, you should first remove them (otherwise skip to step 3): In the DITA Maps Manager right click on the map root and from the contextual menu pick *Find/Replace in Files*. Fill the fields this way: *Text to find: */.*/ *Regular expression**:* Enabled *Restrict to XPath:* //*/@xml:lang/ *Replace with:* (empty) *Scope:* Current DITA Map hierarchy *Include **files:* *.* Press *Replace All...* and Preview the operation to make sure that it does what is expected of it (it should remove the existing xml:lang attributes). 3. To add the xml:lang set on the root element of the files after the last attribute, use again the *Find/Replace in Files* and use the following field values: *Text to find: */.*/ *Regular expression**:* Enabled *Restrict to XPath:* //*/@*[last()]/ *Replace with:* /$0 xml:lang="en_US"/ (modify the value to the one you want to set) *Scope:* Current DITA Map hierarchy *Include **files:* *.* Press *Replace All...* and Preview the operation to make sure that it does what is expected of it (xml:lang should be added after the last attribute of each root element ). Regards, Adrian Adrian Buza oXygen XML Editor and Author Support Tel: +1-650-352-1250 ext.202 Fax: +40-251-461482 support@oxygenxml.com http://www.oxygenxml.com On 04.11.2013 19:32, KAATMAN Matthew wrote:
Is there a way to select a map and apply an xml:lang across every file in that map to the main topic type tag?
Thanks! Matt
AVIS : Ce courrier et ses pieces jointes sont destines a leur seul destinataire et peuvent contenir des informations confidentielles appartenant a bioMerieux. Si vous n'etes pas destinataire, vous etes informe que toute lecture, divulgation, ou reproduction de ce message et des pieces jointes est strictement interdite. Si vous avez recu ce message par erreur merci d'en prevenir l'expediteur et de le detruire, ainsi que ses pieces jointes. NOTICE: This message and attachments are intended only for the use of their addressee and may contain confidential information belonging to bioMerieux. If you are not the intended recipient, you are hereby notified that any reading, dissemination, distribution, or copying of this message, or any attachment, is strictly prohibited. If you have received this message in error, please notify the original sender immediately and delete this message, along with any attachments.
_______________________________________________ oXygen-user mailing list oXygen-user@oxygenxml.com http://www.oxygenxml.com/mailman/listinfo/oxygen-user
participants (2)
-
KAATMAN Matthew
-
Oxygen XML Editor Support