JSF swallows closing tag after SVG

后端 未结 1 941
萌比男神i
萌比男神i 2021-01-18 23:39

I\'m using two elements inside a

    .

    
    
            
相关标签:
1条回答
  • 2021-01-19 00:12

    I can reproduce it in 2.1.24. I'm not sure if this is a bug in Facelets' SAX parser but it indeed look much like that it got confused in nested namespaces. You're with <svg xmlns> declaring a new default XML namespace which has seemingly overriden the <html xmlns> one for HTML tags. I recommend to report this issue to Mojarra guys.

    In any case, the right way of using SVG in Facelets is to split off the whole <svg> content into its own .svg file and include it via <ui:include>.

    <ul>
        <li>
            <ui:include src="/resources/svg/one.svg" />
        </li>
        <li>
            <ui:include src="/resources/svg/two.svg" />
        </li>
    </ul>
    

    This way the namespacing works fine. Additional benefit is, your SVGs are this way instantly reusable.

    0 讨论(0)
提交回复
热议问题