Re: [xslt] Incorrect output using -o option (All info - long post)





Mark Vakoc wrote:

--- Rush Manbert <rush manbert com> wrote:



Hi all,
A new post about this problem, with all the information included this time.



I would suggest running xsltproc --verbose to see exactly what is happening during the transformation.



I'm sorry, when I said I ran xsltproc with --debug, I meant --verbose.

If I do this, then create good.log and bad.log, they are identical until they process the <head> element in snentry.xml. Here are a couple of snippets.

good.log:
------------------------------------------------
Building variable contents select document(string($formcomponentfilename))
Evaluating variable contents
Lookup variable formcomponentfilename
found variable formcomponentfilename
Reusing dictionary for document
Initializing keys on snentry.xml
Object is a Node Set :
Set contains 1 nodes:
1 /
xsltApplyTemplates: node: imlformcomponent
xsltApplyTemplates: select exslt:node-set($contents)
Lookup variable contents
found variable contents
Lookup function {http://exslt.org/common}node-set
found function node-set
xsltApplyTemplates: list of 1 nodes
xsltApplyTemplates: Changing document - context doc snentry.xml, xpathdoc snentry.xml
xsltProcessOneNode: applying template '/' for /
xsltApplyOneTemplate: copy text Template match for /
xsltCopyText: copy text Template match for /
xsltComment: content Template match for /
xsltApplyTemplates: list of 1 nodes
xsltProcessOneNode: applying template '*' for html
applying template 'FormIncludeElementWildcard'
xsltApplyOneTemplate: copy text Template match for *: element type is:
xsltCopyText: copy text Template match for *: element type is:
xsltValueOf: select name()
xsltCopyTextString: copy text html
xsltValueOf: result html
xsltComment: content Template match for *: element type is:html
xsltApplyTemplates: node: html
xsltApplyTemplates: list of 5 nodes
xsltProcessOneNode: no template found for text
xsltDefaultProcessOneNode: copy text


xsltCopyText: copy text

xsltProcessOneNode: applying template '//head' for head <<<<<<---- //head matched here
xsltApplyOneTemplate: copy text Template match for /html/head
xsltCopyText: copy text Template match for /html/head
xsltComment: content Template match for /html/head
xsltProcessOneNode: no template found for text
xsltDefaultProcessOneNode: copy text


------------------------------------------------

bad.log:
------------------------------------------------
Building variable contents select document(string($formcomponentfilename))
Evaluating variable contents
Lookup variable formcomponentfilename
found variable formcomponentfilename
Reusing dictionary for document
Initializing keys on snentry.xml
Object is a Node Set :
Set contains 1 nodes:
1 /
xsltApplyTemplates: node: imlformcomponent
xsltApplyTemplates: select exslt:node-set($contents)
Lookup variable contents
found variable contents
Lookup function {http://exslt.org/common}node-set
found function node-set
xsltApplyTemplates: list of 1 nodes
xsltApplyTemplates: Changing document - context doc snentry.xml, xpathdoc snentry.xml
xsltProcessOneNode: applying template '/' for /
xsltApplyOneTemplate: copy text Template match for /
xsltCopyText: copy text Template match for /
xsltComment: content Template match for /
xsltApplyTemplates: list of 1 nodes
xsltProcessOneNode: applying template '*' for html
applying template 'FormIncludeElementWildcard'
xsltApplyOneTemplate: copy text Template match for *: element type is:
xsltCopyText: copy text Template match for *: element type is:
xsltValueOf: select name()
xsltCopyTextString: copy text html
xsltValueOf: result html
xsltComment: content Template match for *: element type is:html
xsltApplyTemplates: node: html
xsltApplyTemplates: list of 5 nodes
xsltProcessOneNode: no template found for text
xsltDefaultProcessOneNode: copy text


xsltCopyText: copy text

xsltProcessOneNode: applying template '*' for head <<<<---wildcard matched here
applying template 'FormIncludeElementWildcard'
xsltApplyOneTemplate: copy text Template match for *: element type is:
xsltCopyText: copy text Template match for *: element type is:
xsltValueOf: select name()
xsltCopyTextString: copy text head
xsltValueOf: result head
xsltComment: content Template match for *: element type is:head
xsltApplyTemplates: node: head
xsltApplyTemplates: list of 5 nodes
xsltProcessOneNode: no template found for text
xsltDefaultProcessOneNode: copy text
------------------------------------------------


This is the first difference between the --verbose outputs. After that, the bad case just matches the wildcard for everything, and never matches the intended templates. I have no idea why a different template was matched in the "bad" case. It's not as if the "mode" was lost, because the wildcard template includes the mode, just like the others.

Very mysterious for me...

Regards,
Rush



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]