[jira] [Commented] (FELIX-3471) Support Schema validation for MetaData XML documents
[ https://issues.apache.org/jira/browse/FELIX-3471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14285833#comment-14285833 ] J.W. Janssen commented on FELIX-3471: - I've added some additional validations regarding missing elements, such as Objects and ADs (for MetaType v1.3). While this does not come near a real schema validation, it already rejects most common errors in an early stage. Support Schema validation for MetaData XML documents Key: FELIX-3471 URL: https://issues.apache.org/jira/browse/FELIX-3471 Project: Felix Issue Type: Bug Components: Metatype Service Affects Versions: metatype-1.0.4 Reporter: Alexandre Castro Alves MetaData XML documents are not being W3C Schema-validated. Provide option for doing so. Thanks Alex -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (FELIX-3471) Support Schema validation for MetaData XML documents
[ https://issues.apache.org/jira/browse/FELIX-3471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13777930#comment-13777930 ] Matt Bishop commented on FELIX-3471: I think there is a bug in all the metatype XSDs, and particular in the metatype XSDs for v1.1.0 and 1.2.0. I am not sure where to file this bug, but I'll try here and see if it leads somewhere else. Simply put, one cannot create validatable MetaData documents that validate using these XSDs. The problem is that the namespace defined in the schema is not applied to the child elements correctly. Their xsd:schema header elements are missing the all-important elementFormDefault=qualified attributeFormDefault=unqualified pair to allow elements below the MetaData to be found by the parser. This leads from bad, but validatable (1.0.0, notice how only the MetaData element gets a prefix? prefixing the OCD and other children fails): ?xml version=1.0 encoding=UTF-8? metadata:MetaData xmlns:metadata=http://www.osgi.org/xmlns/metatype/v1.0.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.osgi.org/xmlns/metatype/v1.0.0 http://www.osgi.org/xmlns/metatype/v1.0.0/metatype.xsd; OCD description=Configured Example Application name=ConfigApp id=ConfigApp AD name=Title id=title required=true type=String default=Default Title description=Title for the Application/ /OCD Designate pid=ConfigApp Object ocdref=ConfigApp/ /Designate /metadata:MetaData To unvalidatable at all in 1.1.0 / 1.2.0: ?xml version=1.0 encoding=UTF-8? metadata:MetaData xmlns:metadata=http://www.osgi.org/xmlns/metatype/v1.2.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.osgi.org/xmlns/metatype/v1.2.0 http://www.osgi.org/xmlns/metatype/v1.2.0/metatype.xsd; OCD description=Configured Example Application name=ConfigApp id=ConfigApp AD name=Title id=title required=true type=String default=Default Title description=Title for the Application/ /OCD Designate pid=ConfigApp Object ocdref=ConfigApp/ /Designate /metadata:MetaData Also fails if you remove the metadata: prefix. ?xml version=1.0 encoding=UTF-8? metadata:MetaData xmlns:metadata=http://www.osgi.org/xmlns/metatype/v1.2.0; xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; xsi:schemaLocation=http://www.osgi.org/xmlns/metatype/v1.2.0 http://www.osgi.org/xmlns/metatype/v1.2.0/metatype.xsd; metadata:OCD description=Configured Example Application name=ConfigApp id=ConfigApp metadata:AD name=Title id=title required=true type=String default=Default Title description=Title for the Application/ /metadata:OCD metadata:Designate pid=ConfigApp metadata:Object ocdref=ConfigApp/ /metadata:Designate /metadata:MetaData Validation error: cvc-complex-type.2.4.a: Invalid content was found starting with element 'metadata:OCD'. One of '{OCD, Designate, WC[##other:http://www.osgi.org/xmlns/metatype/v1.2.0]}' is expected. Taking out the prefix also fails. In short there is no clear way to use the 1.1.0 and 1.2.0 XSDs for their stated purpose of tools-driven document validation. Support Schema validation for MetaData XML documents Key: FELIX-3471 URL: https://issues.apache.org/jira/browse/FELIX-3471 Project: Felix Issue Type: Bug Components: Metatype Service Affects Versions: metatype-1.0.4 Reporter: Alexandre Castro Alves MetaData XML documents are not being W3C Schema-validated. Provide option for doing so. Thanks Alex -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-3471) Support Schema validation for MetaData XML documents
[ https://issues.apache.org/jira/browse/FELIX-3471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13478982#comment-13478982 ] Felix Meschberger commented on FELIX-3471: -- Just stumbled upon this note in section 105.7.1 on the XML Schema: This section describes the schema of the meta type resource. This schema is not intended to be used during runtime for validating meta type resources. The schema is intended to be used by tools and external management systems. I think reading the metadata should allow for enough validation of the input data. If you have invalid XML for which you think error reporting is insufficient, I would be happy to add better error reporting while reading the file. Support Schema validation for MetaData XML documents Key: FELIX-3471 URL: https://issues.apache.org/jira/browse/FELIX-3471 Project: Felix Issue Type: Bug Components: Metatype Service Affects Versions: metatype-1.0.4 Reporter: Alexandre Castro Alves MetaData XML documents are not being W3C Schema-validated. Provide option for doing so. Thanks Alex -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-3471) Support Schema validation for MetaData XML documents
[ https://issues.apache.org/jira/browse/FELIX-3471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13263920#comment-13263920 ] Alexandre Castro Alves commented on FELIX-3471: --- My application is a design-time application and is invoking the 'load metadata' during a bundle install. If the schema is lax, then there won't be too much of a performance hit, further this feature should be made optional, so client can determine if the hit is accessible in the client's context. As it happens, I did run into a situation where the customer provided an invalid XML document that could have been caught sooner should the metatype implementation have validated it. Of course, I could validate it in the application itself, however we would be parsing the document twice, once for validation, and once by the metatype implementation, which doesn't seem ideal. Thanks Alex Support Schema validation for MetaData XML documents Key: FELIX-3471 URL: https://issues.apache.org/jira/browse/FELIX-3471 Project: Felix Issue Type: Bug Components: Metatype Service Affects Versions: metatype-1.0.4 Reporter: Alexandre Castro Alves MetaData XML documents are not being W3C Schema-validated. Provide option for doing so. Thanks Alex -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-3471) Support Schema validation for MetaData XML documents
[ https://issues.apache.org/jira/browse/FELIX-3471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13261062#comment-13261062 ] Felix Meschberger commented on FELIX-3471: -- Actually the metadata is not read when the bundle is loaded but when the data is actually accessed, which may in-fact never be the case or very late in the lifecycle of the bundle. I fear this puts quite a heavy load on the system just to catch issues, which might also be caught at build time. If it is for design-time errors, these should IMHO be caught during building .. just like Java errors are caught during compilation. Finally, the schema is relatively lax in that it allows for any attributes and any elements to be added anywhere in addition to the defined ones. The defined ones are validated once the files are loaded. Support Schema validation for MetaData XML documents Key: FELIX-3471 URL: https://issues.apache.org/jira/browse/FELIX-3471 Project: Felix Issue Type: Bug Components: Metatype Service Affects Versions: metatype-1.0.4 Reporter: Alexandre Castro Alves MetaData XML documents are not being W3C Schema-validated. Provide option for doing so. Thanks Alex -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-3471) Support Schema validation for MetaData XML documents
[ https://issues.apache.org/jira/browse/FELIX-3471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13258528#comment-13258528 ] Alexandre Castro Alves commented on FELIX-3471: --- The lifecycle I intended would be to validate only during a bundle install (e.g. application deploy), so don't think the cost would be prohibitive. The benefit is that design-time errors would be caught during deployment, rather than later at runtime when the bundle (e.g. application) started processing. Support Schema validation for MetaData XML documents Key: FELIX-3471 URL: https://issues.apache.org/jira/browse/FELIX-3471 Project: Felix Issue Type: Bug Components: Metatype Service Affects Versions: metatype-1.0.4 Reporter: Alexandre Castro Alves MetaData XML documents are not being W3C Schema-validated. Provide option for doing so. Thanks Alex -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (FELIX-3471) Support Schema validation for MetaData XML documents
[ https://issues.apache.org/jira/browse/FELIX-3471?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13257475#comment-13257475 ] Felix Meschberger commented on FELIX-3471: -- That would be quite heavy to do relying on at least one 3rd party library. What would be the benefit ? Support Schema validation for MetaData XML documents Key: FELIX-3471 URL: https://issues.apache.org/jira/browse/FELIX-3471 Project: Felix Issue Type: Bug Components: Metatype Service Affects Versions: metatype-1.0.4 Reporter: Alexandre Castro Alves MetaData XML documents are not being W3C Schema-validated. Provide option for doing so. Thanks Alex -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira