Community Tip - Learn all about the Community Ranking System, a fun gamification element of the PTC Community. X
I need to generate a table with the styler that will grow according to the count of a specific element within the document. For example, the table with header (Column1, Column2, Column3) will have 2 rows if the content of element EnactAuthority has 2 Identification elements within it. It is not a problem for me to count the elements using an XPath predicate. It's more in the way of injecting the content of the Identification elements content inside that table that is my issue.
XML content :
My target table withing styler :
The content of the 2 rows will come from Identification/LongTitle, Identification/Id and Identification/EnablingIdentification/Ref
You have been so far very helpful, once again thanks for your help community !
Solved! Go to Solution.
I think you have a problem with your XPath expressions. When you ask for "/LongTitle", the slash at the beginning indicates you want it to look for that element at the root of the document, not in the current context. If you want to get the LongTitle element as a child of the current element (the Identification element if I'm reading the original post correctly), you should use "./LongTitle" (note the dot before the slash), or simply "LongTitle". So, try rewriting your Regulation expression like this:
concat(string(LongTitle), ' ', string(Id))
Hi @Partner,
Thank you for your question.
Your post appears well documented but has not yet received any response. I am replying to raise awareness. Hopefully, another community member will be able to help.
Also, feel free to add any additional information you think might be relevant.
Regards,
Vivek N
Community Moderation Team
I do have more information in fact.
The perfect way to do this is to use a custom table. I have created the custom table with all the necessary elements,
If I use these custom element table (with the addition of 2 cells) everything works as expected BUT those not match my need since I need to concatenate values coming from multiple referred elements using XPath. So I then figured to use generated cells but no items (text) is showing. Here is a view of my generated cells wanted.
As I said, that did not work, there must be a syntax error somehow.
Merci, thanks.
I think you have a problem with your XPath expressions. When you ask for "/LongTitle", the slash at the beginning indicates you want it to look for that element at the root of the document, not in the current context. If you want to get the LongTitle element as a child of the current element (the Identification element if I'm reading the original post correctly), you should use "./LongTitle" (note the dot before the slash), or simply "LongTitle". So, try rewriting your Regulation expression like this:
concat(string(LongTitle), ' ', string(Id))
I have closed the ticket too fast. My Xpath got accepted but still the table is not showing up.
Can you be more specific about what you mean by "the table is not showing up"? Does that mean you get no table at all? Or that you get a table but it's empty? Maybe a screenshot of the output would help.
The table shows if I don't use Generated cells with the following settings.
And shows like this in the document :
As soon as I set something as Generated cells, no grid shows at all.