Project

Profile

Help

Wrong output with stylesheet having two modes, one streamable, the other not

Added by Martin Honnen almost 9 years ago

I am trying to process an XML file with the structure



  
    
      
        abc
        def
         
          ghi
          jklm
         
         
          opqr
          stuv
         
        
          1000
           
            wxy
            zzzz
           
           
            aaaaa
            bbbb
           
           
            ghi
            jklm
           
        
            .
            .
            .
        
    
  


with Saxon-EE 9.6.0.7J in streaming mode, only for the @Address@ elements I need a non streamable check @Address[LastName = $param]/FirstName@ to change those elements, so I decided to push a @copy-of()@ to a mode not using streaming. Saxon processes the stylesheet and the input without giving any error messages, but does not seem to apply the template of the non-streaming mode. Here is the stylesheet code:



    








  



  
  
    
  



the result I get is the document unchanged:



  
    
      
        abc
        def
         
          ghi
          jklm
         
         
          opqr
          stuv
         
        
          1000
           
            wxy
            zzzz
           
           
            aaaaa
            bbbb
           
           
            ghi
            jklm
           
        
            .
            .
            .
        
    
  

where as the expected result is



  
    
      
        abc
        def
         
          ghi
          foo
         
         
          opqr
          stuv
         
        
          1000
           
            wxy
            zzzz
           
           
            aaaaa
            bbbb
           
           
            ghi
            foo
           
        
            .
            .
            .
        
    
  

with the @FirstName@ elements changed. The demo of Exselt produces the wanted result.


Replies (3)

Please register to reply

RE: Wrong output with stylesheet having two modes, one streamable, the other not - Added by Martin Honnen almost 9 years ago

When I change from @<xsl:mode name="change" on-no-match="shallow-copy"/>@ to





  
    
  


I get the wanted result so somehow the built-in templates supposed to be used by @on-no-match="shallow-copy"@ don't work as intended.

RE: Wrong output with stylesheet having two modes, one streamable, the other not - Added by Michael Kay about 8 years ago

Sorry to leave this with no response for so long. I suspect I wasn't getting notified of posts on this forum for some reason. Raising issues on the bug tracker is better - we have much more control over tracking and searching there.

I'm raising a bug tracker on it, and I'm submitting it as W3C test case si-copy-200

    (1-3/3)

    Please register to reply