in reply to XML::XPath doesn't validate XML???

I think jettoro's right, an XSL application isn't necessarily required to validate the XML (or other) document it's being asked to transform.

If you ask your parser to return the nodeset

//foo/bar[@baz='bof']
and you ask it to look for that nodeset in the string "not xml", it's going to return an empty nodeset. Which is the right answer.

But if you ask it to find the nodeset matching

//foo/bar[@baz='bof]'
it will give you something in $@, because that's bad XSL.


($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print

Replies are listed 'Best First'.
Re^2: XML::XPath doesn't validate XML???
by former33t (Scribe) on May 21, 2007 at 13:10 UTC
    Okay, I can see the use case for that. It just seemed intuitive that that if the object returned then the XML was valid. The error I get when I search for a node that isn't there is from XML::Parser which XML::XPath inherets from.