Just to follow up on a comment I posted on Twitter the other day.
Here's what the Problem was:
I had an XML like:
I had to put them in a table so that it1_1 belongs to it1 so I did:
trying to only select the it but not it_1 (using Oxygen if I search for it[0_9][^_] with regex enabled this works fine)
Running the Transformation with saxon however, this didn't select anything.
I quickly worked around it with a combination of contains and substring-after.
Question though, shouldn't that regex work in the transformation?
Did you mean it[0-9][^_] perhaps?
My understanding is that this matches "it" followed by a digit followed by a character that is not an underscore. It won't match "it5" because the digit is not followed by a character that matches [^_]. Perhaps you should use "^it[0-9]$"
"followed by a character that is not an underscore"
True, I didn't think of it that way, I guess the way Oxygen handles that "no charachter" or maybe \b which marks the end of the Word as I understand is included in that too.
I guess it depends on the implementation of regex then.
Regex is still kind of a mystery to me, that is really fun playing with though.
Oxygen is probably searching the raw XML text, in which case the [^_] matches the closing quote of the attribute value.
There's no \b in XPath regular expressions because of internationalization issues.
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.