OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: DOCBOOK-APPS: Re: needing clarification about XSL transformation


"Robert P. J. Day" wrote:

> 1) technically, comments and processing-instructions will be matched
>    by node(), right?  (that is, those two nodes are in fact child nodes)

Yep.
 
> 2) based on the answer to 1), if i have a template matching "node()"
>    and the built-in rule for "comment()", which one will be used
>    to process comments?  my general "node()" rule?  or the more
>    specific built-in "comment()" rule?  IOW, if i want to do something
>    with either comments or processing instructions, must i add a
>    template that matches *exactly* a comment or procssing-instruction()?

It's easy. If you override template for comment() or
processing-instruction() they will be used in favor of built-in rules
because built-in templates have lower precedence (they behave as if they
were imported):

"The built-in template rules are treated as if they were imported
implicitly before the stylesheet and so have lower import precedence
than all other template rules. Thus, the author can override a built-in
template rule by including an explicit template rule."

If in some XSLT processor node() test doesn't override built in
template, then it is bug.

> basically, if a comment node matches node(), i'd like to think that
> it would be processed by *my* template using "node()", even if there
> is a more specific built-in for "comment()".

It should work that way, as default computed priority should be same for
node() and comment(), so comment() is not more specific and should be
overwritten baceuse of import precedence.

But to be honest, I think that problem layes in a section 5.5.1 of XSLT
spec. I think that Saxon's and xsltproc's understanding of "all matching
template rules" is different.

But this discussion should be probably moved to some xsl specific or
processor specific list. It drifted far away from DocBook processing.

				Jirka

-- 
-----------------------------------------------------------------
  Jirka Kosek  	                     
  e-mail: jirka@kosek.cz
  http://www.kosek.cz




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]