[Xml-compile] Schemas with mixed elements

Mark Overmeer solutions at overmeer.net
Wed Aug 13 12:42:34 BST 2008


* Drew Taylor (drew at drewtaylor.com) [080813 09:30]:
> I was referring to the bit of code below, and talking about the call  
> to panic(). In my sample client, if I specified mixed_elements =>  
> 'STRUCTURED' the panic was triggered. It was probably more a  
> misunderstanding on my part about when I can use STRUCTURAL anyway.

Must be a bug.

> Interesting. I'm slowly coming to the conclusion that it will be just  
> as much work to do things by hand, than deal with these stupid mixed  
> elements!

Yes.  Mixed is difficult
> 
> >> I might see the effort involved in writing
> >>XML::LibXML::Simple::XMLout()...

Just copy the XML::Simple code and tests and start rewriting ;-)

> I was playing with the following this morning:
> sub make_element
>     my $doc = $parser->parse_string(XMLout($data));

Actually, this may be an approach to support by default for mixed
elements.  However... in your case, fixing the STRUCTURED bug (ignoring
the mixed attribute at all) will probably work as well.

Another way, put in your data structure:
   my_mixed_element =>
     XML::LibXML->new->parse_string( <<__LUMP )
<aakjlsacjwlk />
__LUMP

-- 
Regards from YAPC::EU,
               MarkOv

------------------------------------------------------------------------
       Mark Overmeer MSc                                MARKOV Solutions
drs Mark A.C.J. Overmeer                                MARKOV Solutions
       Mark at Overmeer.net                          solutions at overmeer.net
http://Mark.Overmeer.net                   http://solutions.overmeer.net




More information about the Xml-compile mailing list