Move XML element using XDT

f4st

Is there a way to move an XML element, including all of its content, inside another element using XDT?

For example, I'd like to transform the following XML:

<?xml version="1.0"?>
<a>
    <b someAttribute="someValue">someContent</b>
</a>

into this:

<?xml version="1.0"?>
<a>
    <c>
        <b someAttribute="someValue">someContent</b>
    </c>
</a>

by moving the b element inside of the newly created c element. I was hoping that something like the following would work:

<?xml version="1.0"?>
<a xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
    <c xdt:Transform="Insert">
        <b xdt:Locator="XPath(/a/b)" xdt:Transform="an appropriate transform" />
    </c>
</a>

But AFAIK there is no transform that would do this.

Rogier van het Schip

This is currently not supported, as answered in Web.config transforms - surrounding elements, but this question does offer one workaround.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Move XML element using XDT

From Dev

Trying to replace XML element element using XDT and XPath locator

From Dev

move element from an xml file to another xml element using xslt-3

From Dev

Move an XML element from its place, to under another parent element using xslt

From Dev

Clearing out xdt element if it has no children

From Dev

Move a DOM element Using jQuery

From Dev

Move tag to child element xml - xslt

From Dev

How to move any line in a text file or any element in xml file up or down 1 line at a time using Python?

From Dev

How to move an div element up using jQuery?

From Dev

Move element below image using css

From Dev

XML Document Transform (XDT) locator for matching missing attribute

From Dev

Possible to use XDT to transform custom xml in nuget package?

From Dev

How to move a node in XML data using Perl

From Dev

How to move xml elements using xslt?

From Dev

Add Child Element To XML Element using Powershell

From Dev

Add element to XML using XSL

From Dev

Get XML element value using XML to Linq

From Dev

Customizing an XML element using LINQ To XML

From Dev

C#, XML: move second namespace to root element

From Dev

C#, XML: move second namespace to root element

From Dev

How to move a particular element in top using orderBy in angular js

From Dev

Move element backward in a List using Collections.rotate() in Java

From Dev

Using Vim to cut and paste an element and move it to another line efficiently

From Dev

Dynamically move a div above a list element using Javascript

From Dev

How to move an element from inside to out side using jquery?

From Dev

Move position fixed element behind something by using z-index

From Dev

How to move value of JSON element into subelement using bash

From Dev

Validate XML Element Attribute value using XSD

From Dev

XML element to Map in Groovy. Using XMLSluper

Related Related

  1. 1

    Move XML element using XDT

  2. 2

    Trying to replace XML element element using XDT and XPath locator

  3. 3

    move element from an xml file to another xml element using xslt-3

  4. 4

    Move an XML element from its place, to under another parent element using xslt

  5. 5

    Clearing out xdt element if it has no children

  6. 6

    Move a DOM element Using jQuery

  7. 7

    Move tag to child element xml - xslt

  8. 8

    How to move any line in a text file or any element in xml file up or down 1 line at a time using Python?

  9. 9

    How to move an div element up using jQuery?

  10. 10

    Move element below image using css

  11. 11

    XML Document Transform (XDT) locator for matching missing attribute

  12. 12

    Possible to use XDT to transform custom xml in nuget package?

  13. 13

    How to move a node in XML data using Perl

  14. 14

    How to move xml elements using xslt?

  15. 15

    Add Child Element To XML Element using Powershell

  16. 16

    Add element to XML using XSL

  17. 17

    Get XML element value using XML to Linq

  18. 18

    Customizing an XML element using LINQ To XML

  19. 19

    C#, XML: move second namespace to root element

  20. 20

    C#, XML: move second namespace to root element

  21. 21

    How to move a particular element in top using orderBy in angular js

  22. 22

    Move element backward in a List using Collections.rotate() in Java

  23. 23

    Using Vim to cut and paste an element and move it to another line efficiently

  24. 24

    Dynamically move a div above a list element using Javascript

  25. 25

    How to move an element from inside to out side using jquery?

  26. 26

    Move position fixed element behind something by using z-index

  27. 27

    How to move value of JSON element into subelement using bash

  28. 28

    Validate XML Element Attribute value using XSD

  29. 29

    XML element to Map in Groovy. Using XMLSluper

HotTag

Archive