in reply to Re: Parse with XML::Simple: how to keep some tags "unparsed"?
in thread Parse with XML::Simple: how to keep some tags "unparsed"?
It actually is valid - an node is allowed to have mixed content. This snippet will give rise to a schema like:
<?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="page"> <xs:complexType> <xs:sequence> <xs:element name="content"> <xs:complexType mixed="true"> <xs:sequence> <xs:element name="div"> <xs:complexType> <xs:simpleContent> <xs:extension base="xs:string"> <xs:attribute use="required" type="xs:string" na +me="class" /> </xs:extension> </xs:simpleContent> </xs:complexType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute use="required" type="xs:unsignedByte" name="id" /> </xs:complexType> </xs:element> </xs:schema>
However this is certainly not what was intended - if the contents of <content /> are to be taken literally it should be a CDATA section.
/J\
|
|---|