My proposed solution to this is to use the XMLXPathReader to grab each of the parent nodes, such as the following:
<Context xpath=“parent1|parent2” outPort=“0” …/>
This works great, but the problem is that I cannot seem to find a way to get the name of the node that it’s referencing. I’d like to be able to know if it got the metadata from parent1, parent2, etc, in case they need to be parsed differently.
Is this possible, or is there a better means for doing this? If needed, I can emulate includes with parameters and do something like:
I tried using the Autofill fields but they didn’t seem to return the results I need. I think this would be an excellent feature if there’s no means to do this currently.
By specifying parent# elements you are saying that you want to get child elements from the specified parent only. Once you get any child# value, you can send each child# to the same output port.
(You do not need to send each mapped element to an output port, this way - by mapping without any output port - you can specify where the child elements are nested.)
Is this what you wanted to get? (I suppose child elements will not be empty.)
Should you wanted to parse child of different parent in a different way, you can create for each child separate output port. This way they would be sent to six ports instead of three.
We have literally around 100 parent nodes that share the exact same child nodes. The parent node determines how we need to parse the data. Therefore, I was hoping that there was a way to send all the child nodes to the same output ports, but have the system tell me what parent node it came from. This way, we can do the necessary processing without having ports equal to: numChildren x numParents (there’s potentially 100s of child nodes as well, so I don’t want 100 parent nodes x 100 child nodes = 10,000 output ports…I’d much rather have 100 output ports).
I read it with XMLExtract with two edges. One served to get information about parents. The other served to get information about both parents and children.
All children went to the same edge. Thus, the edge for parents consisted of 4 fields. The edge for children consisted of 3 fields for children plus 4 fields for parents.
In your case, you would have 100 fields for parents and 100 fields for children. (100 fields one edge, 200 the other).
You need to create a sequence. Step 1, initial value 1, any cache.
Your mapping will be something like the following: