First a generic comment on questions: if you want a somewhat complete solution, you need to give _all_ of the relevant data. If I can write a test case from the information you give, then I can start really working on it. If the test case is already written, than that's even better BTW.

Here you mention that some of the data is missing, so I can hopefully give you "a nudge in the right direction", but no more, and I can't even really understand properly what you want to do if I know that I am missing some pieces of the puzzle.

With that out of the way... let see if I can give you what you asked for ;--)

The expression that trigger handlers are that: expressions. They are not limited to just tag names. Look for twig_handlers in the docs (badly formatted version here). So you can certainly use an expression like UML:Attribute/UML:ModelElement.taggedValue/UML:TaggedValue[@tag="ea_guid"] to trigger a handler just when you need it.

In order to ignore the rest of the UML:TaggedValue elements, you can just not do anything with them, or if you want to actively prevent them from being included in the document tree, use the ignore method, but that's probably not worth the effort.

Does that help?


In reply to Re: Creating context-specific handlers in XML::Twig by mirod
in thread Creating context-specific handlers in XML::Twig by bobf

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.