Ambiguous rule match in replacing style= attributes in XHTML via XSLT

后端 未结 2 910
隐瞒了意图╮
隐瞒了意图╮ 2021-01-20 19:18

This is a followup to this question.

I have several tags in a document with several semicolon separated style attributes. Right now I have

2条回答
  •  春和景丽
    2021-01-20 19:52

    EDIT: Just in case real problem gets hide, I have simplified the stylesheet:

    
        
        
        
        
        
            
                
            
        
        
            
                
            
            
            
                
                
                    
                        
                    
                
                
                    
                
            
        
        
            
            
                
                    
                        
                            
                        
                    
                
                
                    
                
            
        
        
            
            
                
                
                    
                
                
                    
                
            
        
    
    

    Output:

    some text
    

    Note: Simpler parsing with space normalization to match properties in an existencial comparison. Generating content without optimization (selecting no match, selecting match). "Stateful" or "stackful" named template for output nested elements. Either way there are two rules (identity and span with @style overwriting it) and two names templates (parser/tokenizer and generator of nested content)

    Original stylesheet:

    
        
        
        
        
        
        
        
            
                
            
        
        
            
                
            
            
                
                
                    
                
            
        
        
            
            
            
            
                
                    
                    
                        
                        
                        
                    
                
                
                    
                        
                            
                        
                    
                    
                        
                    
                
                
                    
                        
                            
                        
                    
                
                
                    
                
            
        
        
            
            
            
                
                    
                
                
                    
                        
                        
                    
                    
                        
                        
                    
                
                
                    
                        
                            
                            
                        
                    
                
            
        
    
    

    Note: Recursion paradise. Nested tokenizer for parsing style properties. "Stateful" template for nested content (and performance matching properties, by the way)

提交回复
热议问题