[ 
https://issues.apache.org/jira/browse/SOLR-1669?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12793246#action_12793246
 ] 

Chris A. Mattmann commented on SOLR-1669:
-----------------------------------------

Hey Hoss:

{quote}
1. that doesn't sound right ... i thought Schema declaration URIs were like 
Namespace URIs - they were just a unique name, that the XML parser would then 
be configured with a mapping to a local file (or remote URL) for the parser to 
use? ... it's suppose to be a real URL?!?!?!
{quote}

Schema declaration URIs are like namespace URIs, however, you can provide a 
schemaLocation that is a referenced URL, then the XML parser can decide (as one 
of its strategies) to pull it down. I found this on the XML Schema standards 
site at the W3C:

http://www.w3.org/TR/xmlschema-1/#schema-loc

Here's the relevant part pasted in:

{noformat}
Schema Representation Constraint: Schema Document Location Strategy
Given a namespace name (or none) and (optionally) a URI reference from 
xsi:schemaLocation or xsi:noNamespaceSchemaLocation, schema-aware processors 
may implement any combination of the following strategies, in any order:
1 Do nothing, for instance because a schema containing components for the given 
namespace name is already known to be available, or because it is known in 
advance that no efforts to locate schema documents will be successful (for 
example in embedded systems);
2 Based on the location URI, identify an existing schema document, either as a 
resource which is an XML document or a <schema> element information item, in 
some local schema repository;
3 Based on the namespace name, identify an existing schema document, either as 
a resource which is an XML document or a <schema> element information item, in 
some local schema repository;
4 Attempt to resolve the location URI, to locate a resource on the web which is 
or contains or references a <schema> element;
5 Attempt to resolve the namespace name to locate such a resource.
Whenever possible configuration and/or invocation options for selecting and/or 
ordering the implemented strategies should be provided. 
{noformat}

However, reading this standards doc though suggests something that we can do to 
alleviate this. We can provide the XSD in the SOLR war file and then reference 
it locally as you suggest (by setting xsi:schemaLocation to it).

{quote}
2. If schema URIs really are URLs then we should absolutely NOT reference 
anything in *.apache.org for the schema URL ... we (and our users) don't 
want/need every solr client on the planet hitting the apache webservers for 
this kind of validation. it would make a lot more sense to include the XSD in 
the war and keep it all on the same host
{quote}

Good point. I'll address as part of 1.

> Make XMLWriter write out xml that references the SOLR response XSD/DTD 
> -----------------------------------------------------------------------
>
>                 Key: SOLR-1669
>                 URL: https://issues.apache.org/jira/browse/SOLR-1669
>             Project: Solr
>          Issue Type: Improvement
>          Components: Response Writers
>    Affects Versions: 1.2, 1.3, 1.4
>         Environment: My MacBook Pro, Christmas-break style.
>            Reporter: Chris A. Mattmann
>             Fix For: 1.5
>
>         Attachments: SOLR-1669.Mattmann.121709.patch.txt
>
>
> As described in SOLR-17, this is patch #2 of 3. It will make a simple 
> modification to XMLWriter which makes the output response XML reference the 
> SOLR XSD file. This way, clients can validate against it.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to