MS365电源在线自动化:如何获取特定文本值的XML属性值

发布于 2025-01-21 10:16:41 字数 497 浏览 2 评论 0原文

我希望仅提取WOW:等级值,其中文本在&GT之间; &<从Boom-开始。我能够在&gt之间获得文本值; &<首先是在在线Power Automate 365中使用过滤器的繁荣开始,但我无法同时获得WOW:等级属性值。任何帮助将不胜感激!

<category wow:rank="0">EIGEGenderEquality</category>
<category wow:rank="9" >BOOM-A0304-DiscriminatoryPracticesOnTheBasisOfSex</category>
<category wow:rank="0">EIGEGenderEquality</category>
<category wow:rank="5" url = "www.google.ca">BOOM-EIGEGenderEquality</category>

祝你有美好的一天! :)

I am looking to extract only the wow:rank values at which the text in between the > and < starts with BOOM-. I was able to get the text values in between the > and < that start with BOOM- using filters in power automate 365 online, but i just couldn't simultaneously get the wow:rank attribute values. Any help would be greatly appreciated!

<category wow:rank="0">EIGEGenderEquality</category>
<category wow:rank="9" >BOOM-A0304-DiscriminatoryPracticesOnTheBasisOfSex</category>
<category wow:rank="0">EIGEGenderEquality</category>
<category wow:rank="5" url = "www.google.ca">BOOM-EIGEGenderEquality</category>

Have a great day! :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

恰似旧人归 2025-01-28 10:16:41

看来PowerAutomate XPATH表达式(与XML相结合)无法处理属性的提取。它仅提供了根据所提供的给定Xquery表达式过滤所有元素的能力。

在这种情况下,您可以在XML中的每个元素上使用以下表达式来获得结果... ...

replace(split(split(variables('XML String'), 'wow:rank="')[1], '"')[0], '"', '')

...在初始化wow:rank sept septh中应用。

除此之外,您可以通过对服务为您提供的服务进行API来使其变得更加复杂,但它可能工作得多,而且不值得。

如果您的情况更加复杂,那么我会考虑这样做。

It looks as though the PowerAutomate xpath expression (coupled with xml) doesn't handle the extraction of attributes. It merely provides the ability to filter on all elements based on the given xquery expression provided.

In that case, you can use the below expression on each element within your XML to get your result ...

replace(split(split(variables('XML String'), 'wow:rank="')[1], '"')[0], '"', '')

... that was applied in the Initialize wow:rank step below.

Flow

Outside of that, you could make it a lot more complex by making an API call to a service that does it for you but it's potentially a lot more work and not really worth it.

If your scenario was more complex, then I'd look into doing that.

∞琼窗梦回ˉ 2025-01-28 10:16:41

您可以使用@符号来轻松属于属性,例如@wow:rank

在“适用于每个”的“应用”中,您将使用:

xpath(xml(item()), 'string(/category/@wow:rank)')

循环遍历它们。

You can get to attributes easily by using the @ symbol, like @wow:rank.

In a "Apply to each", you would use:

xpath(xml(item()), 'string(/category/@wow:rank)')

to loop through each of them.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文