Question

I wanted to embed HTML formatting and so I did

        <xs:element name="boobie">
            <xs:complexType mixed="true">
                <xs:sequence>
                    <xs:any namespace="http://www.w3.org/1999/xhtml"
                            minOccurs="0"
                            maxOccurs="unbounded" 
                            processContent="skip"/>
                </xs:sequence>          
            </xs:complexType>
        </xs:element>

However, when I put li tag (dot point element for HTML) inside the XML file (inside boobie tag) it generates error that it is unexpected.

What is wrong with this? is the only way to put html tag inside XMl file is to use CDATA?

Was it helpful?

Solution

If your HTML is not fully XML-compatible (i.e. XHTML) then you cannot include it in an XML document except as CDATA.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top