Re: [PEPr] Comment on Semantic Web::XML_GRDDL
| From: | till | Date: | Sun, 02 Mar 2008 19:06:04 +0000 |
| Subject: | Re: [PEPr] Comment on Semantic Web::XML_GRDDL | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49230@lists.php.net to get a copy of this message | ||
On 2 Mar 2008 14:33:09 -0000, Daniel O'Connor <daniel.oconnor@gmail.com> wrote:
>
> Daniel O'Connor (http://pear.php.net/user/doconnor) has commented on the proposal for
> Semantic Web::XML_GRDDL.
>
> Comment:
>
>
> >> 2) I have a pre-rendered out RDF/XML document to compare my generated
>
> >> (...)
>
> >> - there's no PHPUnit::assertEqual($xml, $other_xml); which handles all
>
> >> of the ins and outs that a string comparison won't cut it for.
>
>
>
> > Can you explain this? Are you talking about the difference in linebreaks
> and possible whitespace? Or what exactly keeps you from a simple string
> comparison?
> Well, it's not just whitespace, line endings and other minor snafu.
Hmm, I gotcha. Maybe similar_text() or levenshtein() help? Not sure if
this is appropriate though. From your examples similar_text() reports
that the XML "A" and "B" are ~70% identical which doesn't really say
"PASS", but is also not really "FAIL". ;-)
You could also count tags and assign checksums to see if they add up -
then again that could still be a complete fail if the XML data is not
in order/invalid. But I guess if the XML is valid (I am thinking basic
valid format AND dtd) you could go the checksum-route.
Maybe you need to transform (= clean) the XML data before you compare
it? Stylesheets, or something? I am totally clueless how though.:-)
Cheers,
Till