This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
It seems as though XML Schemas are not using mounted catalogs at all to find the schema document associated with a particular namespace.
Do you use <uri .../> entries to declare this in catalog?
In this case, no I do not use uri as I'm using a urn:publicid:... This is really a follow-on bug to 40338: http://www.netbeans.org/issues/show_bug.cgi?id=40338 Here's an example. This document/schema/catalog combination works through Xerces 2.6.2: The schema: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:publicid:IDN+cde.berkeley.edu:milowski:schemas:example-form:event:200402" xmlns="urn:publicid:IDN+cde.berkeley.edu:milowski:schemas:example-form:event:200402"> <xsd:element name="event"> <xsd:complexType> <xsd:sequence> <xsd:element name="title" form='qualified' type="xsd:string"/> <xsd:element name="location" form='qualified' type="xsd:string"/> <xsd:element name="presenter" form='qualified' type="xsd:string"/> <xsd:element name="description" form='qualified'> <xsd:complexType> <xsd:sequence> <xsd:element name="p" form='qualified' type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name="start-date" type="xsd:string" use="required"/> </xsd:complexType> </xsd:element> </xsd:schema> The catalog: <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog" prefer='public'> <uri name="http://cde.berkeley.edu/~milowski/schemas/example-form/event/200402" uri="event.xsd"/> <public publicId="IDN cde.berkeley.edu//milowski//schemas//example-form//event//200402" uri="event.xsd"/> </catalog> The instance: <?xml version="1.0" encoding="UTF-8"?> <event xmlns="urn:publicid:IDN+cde.berkeley.edu:milowski:schemas:example-form:event:200402" start-date="4/16/2004" > <title>Practical RDF</title> <location>Room 202, South Hall</location> <presenter>Norm Walsh</presenter> <description><p>Norm Walsh is coming to talk about pratical RDF.</p></description> </event>
Petr P, you can take the implementation directly from Xerces (probably default EntityResolver impl). I hope it's not Xerces specifics document/schema/catalog combination handling and that a specification exists.
Alex provided link to spec <http://www.faqs.org/rfcs/rfc3151.html>. It could also address current problems with validating deploment descriptors described using XML Schema.
In the issue 45212 are the instructions how to add scheams to XML catalog. *** This issue has been marked as a duplicate of 45212 ***
I don't think it is a dup. Please resolve this issue again without marking this bug as duplicate of mentioned issue. That issue is hotchpotch of everything. Thanks
For XML validation against XML schema, the systemId should be mapped to a uri string pointing to the location. The XML Oasis Catalog template describes how to do that.
Created attachment 17406 [details] OASIS Catalog
Created attachment 17407 [details] Sample Document that should validate
Created attachment 17408 [details] XML Schema for event.xml
Created attachment 17409 [details] Sample Driver for Xerces
This schema is not resolved via a system identifier. It uses a 'public' element in the catalog to resolve the URN of the XML namespace for the schema. This does not work inside Netbeans but it does work outside via Xerces. If you mount the catalog, it properly shows the mapping of the public identifier but the validate button on a conforming document says that it can't find the declaration of the root element. I have attached sample files and a sample driver for Xerces.
Thank you very much for the example. Now I understand what's the problem. We use the own implementation of entity catalog - that's the problem. We should switch to the standard Apache resolver-1.1 version (as used in the example). This issue is very similar to the issue 48029 and both depend on the issue 27930. However I can trach this as a standalone issue.
Fixed. The diffs are referenced in issue 48029. Thank you Alex for your assistance.