Skip to content

Commit 1625cbb

Browse files
authored
Merge pull request #131347 from PramodValavala-MSFT/patch-125
(AzureCXP) fix sample xml payloads
2 parents f7a4198 + fd89800 commit 1625cbb

File tree

1 file changed

+78
-6
lines changed

1 file changed

+78
-6
lines changed

articles/logic-apps/workflow-definition-language-functions-reference.md

Lines changed: 78 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4903,7 +4903,21 @@ xpath('<xml>', '<xpath>')
49034903

49044904
Suppose that you have this `'items'` XML string:
49054905

4906-
`"<?xml version="1.0"?> <produce> <item> <name>Gala</name> <type>apple</type> <count>20</count> </item> <item> <name>Honeycrisp</name> <type>apple</type> <count>10</count> </item> </produce>"`
4906+
```xml
4907+
<?xml version="1.0"?>
4908+
<produce>
4909+
<item>
4910+
<name>Gala</name>
4911+
<type>apple</type>
4912+
<count>20</count>
4913+
</item>
4914+
<item>
4915+
<name>Honeycrisp</name>
4916+
<type>apple</type>
4917+
<count>10</count>
4918+
</item>
4919+
</produce>
4920+
```
49074921

49084922
This example passes in the XPath expression, `'/produce/item/name'`, to find the nodes that match the `<name></name>` node in the `'items'` XML string, and returns an array with those node values:
49094923

@@ -4935,7 +4949,21 @@ Here is the result: `Honeycrisp`
49354949

49364950
In this example, suppose your `items` XML string also contains the attributes, `expired='true'` and `expired='false'`:
49374951

4938-
`"<?xml version="1.0"?> <produce> <item> <name expired='true'>Gala</name> <type>apple</type> <count>20</count> </item> <item> <name expired='false'>Honeycrisp</name> <type>apple</type> <count>10</count> </item> </produce>"`
4952+
```xml
4953+
<?xml version="1.0"?>
4954+
<produce>
4955+
<item>
4956+
<name expired='true'>Gala</name>
4957+
<type>apple</type>
4958+
<count>20</count>
4959+
</item>
4960+
<item>
4961+
<name expired='false'>Honeycrisp</name>
4962+
<type>apple</type>
4963+
<count>10</count>
4964+
</item>
4965+
</produce>
4966+
```
49394967

49404968
This example passes in the XPath expression, `'//name[@expired]'`, to find all the `name` elements that have the `expired` attribute:
49414969

@@ -4947,7 +4975,21 @@ Here is the result: `[ Gala, Honeycrisp ]`
49474975

49484976
In this example, suppose your `items` XML string contains only this attribute, `expired = 'true'`:
49494977

4950-
`"<?xml version="1.0"?> <produce> <item> <name expired='true'>Gala</name> <type>apple</type> <count>20</count> </item> <item> <name>Honeycrisp</name> <type>apple</type> <count>10</count> </item> </produce>"`
4978+
```xml
4979+
<?xml version="1.0"?>
4980+
<produce>
4981+
<item>
4982+
<name expired='true'>Gala</name>
4983+
<type>apple</type>
4984+
<count>20</count>
4985+
</item>
4986+
<item>
4987+
<name>Honeycrisp</name>
4988+
<type>apple</type>
4989+
<count>10</count>
4990+
</item>
4991+
</produce>
4992+
```
49514993

49524994
This example passes in the XPath expression, `'//name[@expired = 'true']'`, to find all the `name` elements that have the attribute, `expired = 'true'`:
49534995

@@ -4962,7 +5004,21 @@ In this example, suppose your `items` XML string also contains these attributes:
49625004
* `expired='true' price='12'`
49635005
* `expired='false' price='40'`
49645006

4965-
`"<?xml version="1.0"?> <produce> <item> <name expired='true' price='12'>Gala</name> <type>apple</type> <count>20</count> </item> <item> <name expired='false' price='40'>Honeycrisp</name> <type>apple</type> <count>10</count> </item> </produce>"`
5007+
```xml
5008+
<?xml version="1.0"?>
5009+
<produce>
5010+
<item>
5011+
<name expired='true' price='12'>Gala</name>
5012+
<type>apple</type>
5013+
<count>20</count>
5014+
</item>
5015+
<item>
5016+
<name expired='false' price='40'>Honeycrisp</name>
5017+
<type>apple</type>
5018+
<count>10</count>
5019+
</item>
5020+
</produce>
5021+
```
49665022

49675023
This example passes in the XPath expression, `'//name[price>35]'`, to find all the `name` elements that have `price > 35`:
49685024

@@ -4974,7 +5030,21 @@ Here is the result: `Honeycrisp`
49745030

49755031
In this example, suppose your `items` XML string is the same as in Example 1:
49765032

4977-
`"<?xml version="1.0"?> <produce> <item> <name>Gala</name> <type>apple</type> <count>20</count> </item> <item> <name>Honeycrisp</name> <type>apple</type> <count>10</count> </item> </produce>"`
5033+
```xml
5034+
<?xml version="1.0"?>
5035+
<produce>
5036+
<item>
5037+
<name>Gala</name>
5038+
<type>apple</type>
5039+
<count>20</count>
5040+
</item>
5041+
<item>
5042+
<name>Honeycrisp</name>
5043+
<type>apple</type>
5044+
<count>10</count>
5045+
</item>
5046+
</produce>
5047+
```
49785048

49795049
This example finds nodes that match the `<count></count>` node and adds those node values with the `sum()` function:
49805050

@@ -4986,7 +5056,9 @@ Here is the result: `30`
49865056

49875057
In this example, suppose you have this XML string, which includes the XML document namespace, `xmlns="http://contoso.com"`:
49885058

4989-
`"<?xml version="1.0"?> <file xmlns="http://contoso.com"> <location>Paris</location> </file>"`
5059+
```xml
5060+
<?xml version="1.0"?><file xmlns="http://contoso.com"><location>Paris</location></file>
5061+
```
49905062

49915063
These expressions use either XPath expression, `/*[name()="file"]/*[name()="location"]` or `/*[local-name()="file" and namespace-uri()="http://contoso.com"]/*[local-name()="location"]`, to find nodes that match the `<location></location>` node. These examples show the syntax that you use in either the Logic App Designer or in the expression editor:
49925064

0 commit comments

Comments
 (0)