Xpath to the tag inside CDATA

前端 未结 2 1165
名媛妹妹
名媛妹妹 2020-12-22 09:27

I want to find the xpath to a tag which is inside a CDATA. Below the xml fragment.


 
  
  

        
2条回答
  •  爱一瞬间的悲伤
    2020-12-22 10:19

    As Leif said, the content in the CDATA section is not parsed, so it's just text, even though it looks like markup. You'd have to parse it. Which you could do using Saxon (9.1 or later commercial editions) and saxon:parse. You'd then find it's not well formed, so you'd probably have to resort to a parser such as TagSoup to parse it.

    You could also treat it as a string:

    
      
        
          
          
            
          
        
      
    
    

提交回复
热议问题