Skip Menu |

This queue is for tickets about the XML-Compile CPAN distribution.

Report information
The Basics
Id: 83274
Status: resolved
Priority: 0/
Queue: XML-Compile

People
Owner: Nobody in particular
Requestors: SREZIC [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 1.31
Fixed in: 1.32



Subject: xml2yaml should use mixed_elements => TEXTUAL
For the attached xhtml file xml2yaml would create the following representation: --- body: cho_block: - p: _: !!perl/scalar:XML::LibXML::Element 34418110592 _MIXED_ELEMENT_MODE: ATTRIBUTES head: title: _: !!perl/scalar:XML::LibXML::Element 34418110528 _MIXED_ELEMENT_MODE: ATTRIBUTES (For your convenience, the required schema files may be downloaded from http://www.w3.org/2002/08/xhtml/xhtml1-strict.xsd and http://www.w3.org/2001/xml.xsd) The usage of internal perl objects is not very useful here. It would probably better to use mixed_elements => 'TEXTUAL' instead, which yields the following output: --- body: cho_block: - p: _: Mixed test _MIXED_ELEMENT_MODE: TEXTUAL head: title: _: test _MIXED_ELEMENT_MODE: TEXTUAL As this is sometimes losing information (in this example the <span> is completely lost), it would maybe be better to allow the user to specify another option for mixed_elements, e.g. XML_STRING. Regards, Slaven
Subject: test.xhtml
Download test.xhtml
application/xhtml+xml 188b

Message body not shown because it is not plain text.

Subject: Re: [rt.cpan.org #83274] xml2yaml should use mixed_elements => TEXTUAL
Date: Mon, 11 Feb 2013 22:51:22 +0100
To: Slaven_Rezic via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Slaven_Rezic via RT (bug-XML-Compile@rt.cpan.org) [130211 21:04]: Show quoted text
> Mon Feb 11 16:04:26 2013: Request 83274 was acted upon. > Transaction: Ticket created by SREZIC > Queue: XML-Compile > Subject: xml2yaml should use mixed_elements => TEXTUAL > Broken in: 1.31
Hey Slaven, My intention was data-centric XML, not HTML. But... users go where no-one expects ;-) Show quoted text
> For the attached xhtml file xml2yaml would create the following > representation: > > As this is sometimes losing information (in this example the <span> is > completely lost), it would maybe be better to allow the user to specify > another option for mixed_elements, e.g. XML_STRING.
Ah, that's not my intention... TEXTUAL uses $node->textContent, but aI expected it would include sub-nodes as well. I think it should be changed into nodeValue(). Let's try. See you next month! -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
On 2013-02-11 16:51:41, solutions@overmeer.net wrote: Show quoted text
> * Slaven_Rezic via RT (bug-XML-Compile@rt.cpan.org) [130211 21:04]:
> > Mon Feb 11 16:04:26 2013: Request 83274 was acted upon. > > Transaction: Ticket created by SREZIC > > Queue: XML-Compile > > Subject: xml2yaml should use mixed_elements => TEXTUAL > > Broken in: 1.31
> > Hey Slaven, > My intention was data-centric XML, not HTML. But... users go > where no-one expects ;-)
This was just a bad example...I just wanted to give you a sample with a well-known schema. Originally I stumbled over the problem when dealing with a data-centric file. Granted, the .xsd was the result of a .dtd translated with trang, so it might be that the resulting schema was somewhat suboptimal. Show quoted text
>
> > For the attached xhtml file xml2yaml would create the following > > representation: > > > > As this is sometimes losing information (in this example the <span> is > > completely lost), it would maybe be better to allow the user to specify > > another option for mixed_elements, e.g. XML_STRING.
> > Ah, that's not my intention... TEXTUAL uses $node->textContent, but > aI expected it would include sub-nodes as well. I think it should > be changed into nodeValue(). Let's try.
Actually, no _text_ content is lost here. In the example, the text enclosed by the <span> tags was also converted, just the <span> tag was missing. So no need to try nodeValue here, I think. Show quoted text
> > See you next month!
See ya!
Subject: Re: [rt.cpan.org #83274] xml2yaml should use mixed_elements => TEXTUAL
Date: Mon, 11 Feb 2013 23:47:12 +0100
To: Slaven_Rezic via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Slaven_Rezic via RT (bug-XML-Compile@rt.cpan.org) [130211 21:04]: Show quoted text
> Mon Feb 11 16:04:26 2013: Request 83274 was acted upon. > Transaction: Ticket created by SREZIC > Queue: XML-Compile > Subject: xml2yaml should use mixed_elements => TEXTUAL > Broken in: 1.31 > > For the attached xhtml file xml2yaml would create the following > representation:
I have added the --mixed option for the next release, with TEXTUAL as default. That is a more useful default for this application. -- Thanks Slaven, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Subject: Re: [rt.cpan.org #83274] xml2yaml should use mixed_elements => TEXTUAL
Date: Mon, 11 Feb 2013 23:48:08 +0100
To: Slaven_Rezic via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* Slaven_Rezic via RT (bug-XML-Compile@rt.cpan.org) [130211 22:38]: Show quoted text
> Queue: XML-Compile > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=83274 > > > Actually, no _text_ content is lost here. In the example, the text > enclosed by the <span> tags was also converted, just the <span> tag was > missing. So no need to try nodeValue here, I think.
You're right. (of course) -- MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Got solved in March