Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
myNode
<catalog catalog-id="test-catalog">
<product product-id="TEST-bs-variant-01">
<custom-attributes>
<custom-attribute attribute-id="color">red</custom-attribute>
</custom-attributes>
</product>
<product product-id="TEST-bs-variant-02">
<custom-attributes>
<custom-attribute attribute-id="alternativeColor">navy</custom-attribute>
<custom-attribute attribute-id="color">blue</custom-attribute>
</custom-attributes>
</product>
</catalog>
]
ACTUAL EXPECTED
.------------------+-----. .------------------+-----.
| tLogRow_1 | | tLogRow_1 |
|=-----------------+----=| |=-----------------+----=|
|productID |color| |productID |color|
|=-----------------+----=| |=-----------------+----=|
|TEST-bs-variant-01|null | |TEST-bs-variant-01|red |
|TEST-bs-variant-02|null | |TEST-bs-variant-02|blue |
'------------------+-----' '------------------+-----'
You are making this more complicated than it needs be. You do not need to use an XPath query for this. Your available attributes on your row1 dataset are prefixed with @. Just drag them to the other side. If you really want to use XPath queries to extract your data, maybe try using the tExtractXMLField component (). This is what I use to deal with more complicated XML structures.
But if you simply want to get the value of an element based on its attribute value, this can be done by using the attribute and the element with a tXMLMap variable.