Subject: RE: [xsl] Saxon Error: Conditional Transformation Matches BOTH of "Either/Or" Template From: Raymond Lillibridge <RLillibridge@xxxxxxxxxxxx> Date: Thu, 6 Jun 2013 12:05:46 +0000 |
Andrew (and Michael), First, "Thanks" again for your kind input. I've been able to get things working and I thought I'd share my solution with the group. Using: match="para[not(@selectout) or contains(@selectout, 'html')]" does not work because the "contains(@selectout, 'html')" clause returns a boolean and not a node(). Creating two templates simplified everything and now all is well: <xsl:template match="para[@selectout]"> <xsl:if test="contains(@selectout, 'html')"> ... </xsl:if> <xsl:if test="not(contains(@selectout, 'html'))"> <!-- do nothing --> </xsl:if> </xsl:template> <xsl:template match="para[not(@selectout)]"> ... </xsl:template> Cheers, Raymond Lillibridge Sr. Software Engineer Municipal Code Corporation www.municode.com ________________________________________ From: Andrew Welch [andrew.j.welch@xxxxxxxxx] Sent: Thursday, June 06, 2013 7:34 AM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Re: [xsl] Saxon Error: Conditional Transformation Matches BOTH of "Either/Or" Template Saxon should tell you the line numbers and match patterns of the two templates that have the same match priority in the warning message... you seem to be posting only half the message. If that is genuinely all you are seeing, then raise it over on the saxon-help list as they will be keen to hear about it. If not, then please post the full warning message, or your full xslt if its small enough, or a small complete runnable example that recreates the problem. cheers andrew On 6 June 2013 12:26, Raymond Lillibridge <RLillibridge@xxxxxxxxxxxx> wrote: > Michael, > > Thank you for your kind input. I did debate about adding the prefix of "Saxon Error:" to my subject line. In the end, I decided to add it to help filter out those not familiar with Saxon. In the future I will refrain from adding similar prefixes. My intent was not to point a finger at Saxon. > > Initially I did put the "or" clause inside the predicate, like you suggested. Still, I received the same "Error" message. > > At this point, I will do some more reading and testing. I'm pretty sure the problem is with my understanding. Saxon is a great product and has never proved to be a problem for the last five years I've been using it. So, back to "XSLT 2.0 and XPath 2.0 4th Ed. Programmer's Reference" by Michael Kay. > > > Cheers, > > Raymond Lillibridge > Sr. Software Engineer > Municipal Code Corporation > www.municode.com > > ________________________________________ > From: Michael M|ller-Hillebrand [mmh@xxxxxxxxx] > Sent: Wednesday, June 05, 2013 3:22 PM > To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx > Subject: Re: [xsl] Saxon Error: Conditional Transformation Matches BOTH of "Either/Or" Template > > Am 05.06.2013 um 20:58 schrieb Raymond Lillibridge <RLillibridge@xxxxxxxxxxxx>: > >> Saxon error message: >> Recoverable error >> XTRE0540: Ambiguous rule match for /level1/para[44] >> Matches both "para[not(@selectout)] | para[contains(@selectout, 'html')]" >> >> I'm at a loss as to how the template matches both conditions at the same time. From my understanding (which probably leaves much to be desired), either the para element doesn't have the @selectout attribute or (if it does) the @selectout attribute contains 'html'. > > Raymond, > > I have the strong feeling that this is not all of the error message, as I have only seen it giving you the other match as well > > Anyway, why don't you put the or clause inside the predicate? > > match="para[not(@selectout) or contains(@selectout, 'html')]" > > - Michael > > PS: If you think this would be a Saxon error you should have directed your question to the saxon-help list. If you think it is an XSLT problem, please do not prefix your subject like you did. > > -- > Michael M|ller-Hillebrand > mmh@xxxxxxxxx > > > --~------------------------------------------------------------------ > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> > --~-- > > > --~------------------------------------------------------------------ > XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list > To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/ > or e-mail: <mailto:xsl-list-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx> > --~-- > -- Andrew Welch http://andrewjwelch.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Saxon Error: Conditional , Andrew Welch | Thread | Re: [xsl] Saxon Error: Conditional , Andrew Welch |
Re: [xsl] Saxon Error: Conditional , Andrew Welch | Date | Re: [xsl] Saxon Error: Conditional , Andrew Welch |
Month |