Hi,
I am having a problem that is totally driving me nuts (Cocoon 2.1.10): I am using the ValidationReportTransformer to create a report why a validation of an xml-document failed. I nicely outputs a report with a nice little xmlns attribute ... this is driving me nuts: <?xml version="1.0" encoding="ISO-8859-1"?> <report xmlns="http://apache.org/cocoon/validation/1.0"> <error line="11">cvc-minLength-valid: Value 'Dutz' with length = '4' is not facet-valid with respect to minLength '6' for type '#AnonType_namekontaktladeraumangebot'.</error> <error line="11">cvc-type.3.1.3: The value 'Dutz' of element 'name' is not valid.</error> <error line="24">cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_plzfreiladeraumangebot'.</error> <error line="24">cvc-type.3.1.3: The value '' of element 'plz' is not valid.</error> <error line="25">cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_ortfreiladeraumangebot'.</error> <error line="25">cvc-type.3.1.3: The value '' of element 'ort' is not valid.</error> <error line="26">cvc-minLength-valid: Value '' with length = '0' is not facet-valid with respect to minLength '1' for type '#AnonType_landfreiladeraumangebot'.</error> <error line="26">cvc-type.3.1.3: The value '' of element 'land' is not valid.</error> <error line="36">cvc-datatype-valid.1.2.1: '' is not a valid value for 'integer'.</error> <error line="36">cvc-type.3.1.3: The value '' of element 'fahrzeugtyp' is not valid.</error> </report> As soon as this xmlns-attribute is there no XSL transformation seems to work. For example: If I simply want to replace the root element "report" with a "test" element, this xsl should do the job: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns="http://apache.org/cocoon/validation/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="/report"> <test> <xsl:copy-of select="error"/> </test> </xsl:template> </xsl:stylesheet> Unfortunetly the "/report" doesn't match and the pure text is copied to the output. If I change it to " <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns="http://apache.org/cocoon/validation/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="/"> <test> <xsl:copy-of select="error"/> </test> </xsl:template> </xsl:stylesheet> At least the test is copied. The only transformation that works is: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns="http://apache.org/cocoon/validation/1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="/*"> <test> <xsl:copy-of select="*"/> </test> </xsl:template> </xsl:stylesheet> Could someone tell me why this is that way and how I can convince the validation-report transformer to stop adding the namespace stuff to the output? Well at the moment I got everything to work, by modifying the Transformers code, but that can't really be the optimal solution. Regards, Christofer Dutz [ c h r i s t o f e r d u t z ] IT-Berater univativ GmbH & Co. KG Robert-Bosch-Str. 7, 64293 Darmstadt fon: 0 61 51 / 66 717 - 21 fax: 0 61 51 / 66 717 - 29 email: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> http://www.univativ.de Darmstadt, Stuttgart, Karlsruhe, Düsseldorf, München
<<winmail.dat>>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
