Yes, I think the behavior is wrong. IMO IDEA should only try to resolve schemaLocation URIs, and possibly, at user option try to dereference the namespace name of a document's root element. (but never flag the unavailability of a schema as an error if the lookup or retrieval was based on a namespace name)
Trying to use a schemaLocation as a base uri to find schemas that are supposedly identified by relative uris used as namespace maes is wrong in at least two ways: - The XML Information Set [http://www.w3.org/TR/xml-infoset/] does not define an information set for documents which use relative URI references in namespace declarations. This should possibly be marked as an error by IDEA unrelated to schema validation. - The XML Schema Recommendation does not support the notion of locating schemas for sub elements that dont explicitly state a schemaLocation attribute. If IDEA has internal semantic knowledge of some set of commonly used namespaces, that is of course good, and I fully support the use of that knowledge in the XML editing support. What I argue against is relating the use of namespaces to the use of W3C XML Schemas. Namespaces is an often disputed but generally accepted technology for XML. When it comes to schemas I think many of us will try to aviod the use of W3C XML Schemas as long as possible and instead use better alternatives such as RELAX NG. It would be a pity if IDEA would force us to use W3C XML Schemas just to avoid error signaling when we use XML namespaces. The relevant part of the Namespaces in XML Recommendation says: [Definition:] The attribute's value, a URI reference, is the namespace name identifying the namespace. The namespace name, to serve its intended purpose, should have the characteristics of uniqueness and persistence. It is not a goal that it be directly usable for retrieval of a schema (if any exists). An example of a syntax that is designed with these goals in mind is that for Uniform Resource Names [RFC2141]. However, it should be noted that ordinary URLs can be managed in such a way as to achieve these same goals. I can't see any reason to flag the unavailability of retrievable resource matching the namespace name as an error. /Fredrik Lindgren Mike Aizatsky wrote: > Frederik, > > >>The thing is that it is not a URL, it is a URI reference as specified >> > in > >>the Namespaces in XML Recommedation. >> > > I didn't say that IDEA treats it as URL. It really treats it as URI. > > >>IDEA shouldn't try to retrieve it >>unless explicitly asked for, for example by the user clicking on it. >> > > IDEA also doesn't try to retrieve it. Instead, it tries to resolve URI > into file URL according to several well-defined rules. They are: > > 1. If there's schemaLocation attribute defined, URI is transformed > into another URI from it. > 2. If there's mapping defined in External Resources for that URI, the > mapping value is taken. > > After stage 2 IDEA tries to find file with the resulted path. If it > can't, IDEA marks the URI as the error. Do you think that the specified > behaviour is wrong? > > Best regards, > Mike Aizatsky. > ------------------------------ > JetBrains, Inc / IntelliJ Software > http://www.intellij.com > "Develop with pleasure!" > > >>-----Original Message----- >>From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] >> > On > >>Behalf Of Fredrik Lindgren >>Sent: Saturday, March 16, 2002 1:29 AM >>To: [EMAIL PROTECTED] >>Subject: Re: [Eap-list] 611 : 'false' error detected in xml >> >>The thing is that it is not a URL, it is a URI reference as specified >> > in > >>the Namespaces in XML Recommedation. >>[http://www.w3.org/TR/1999/REC-xml-names-19990114/] >>The only specified significance of the attribute value of a namespace >>declaration is the actual sequence of characters. There is no >> > specified > >>meaning of any retrievable resource. IDEA shouldn't try to retrieve it >>unless explicitly asked for, for example by the user clicking on it. >> >>The meaning of the namespace declaration for a general XML processor >> > is > >>local and most certainly known to IDEA. Some particular namespaces >> > have > >>semantics specified for particular processors, such as the XSLT >>namespace has for XSLT processors. In general though, the namespace >> > name > >> has no meaningful semantics for an XML editor. >> >>I'm sorry Mike if this comes across a bit agitated but I get that way >>whenever I come across the missunderstanding of relating namespace >>declarations and XML Schemas. The problems of namespace declarations >>looking like URLs has been discussed for years on the XML-developers >>list with one one of the worries beening that tool vendors risk making >>the misstake to think that they should try to retrieve the name. >> >>I'm confident that IDEA will handle namespace declarations properly >>eventually. >> >>Regards, >>Fredrik Lindgren >>(A happy IDEA user with strong opinions on XML related matters) >> >> >> >>Mike Aizatsky wrote: >> >> >>>Edoardo, >>> >>>You should specify some schema associated with url >>>"capeconnect:Perf:PerfTest" in external resources. In fact, IDEA >>> > doesn't > >>>make a difference between URI protocols. I just says that this URI >>> > is > >>>unknown to IDEA. >>> >>>Best regards, >>>Mike Aizatsky. >>>------------------------------ >>>IntelliJ Software, "Develop with pleasure!" http://www.intellij.com >>> >>> >>> >>> >>>>-----Original Message----- >>>>From: [EMAIL PROTECTED] >>>> > [mailto:[EMAIL PROTECTED]] > >>>On >>> >>> >>>>Behalf Of Edoardo Comar >>>>Sent: Friday, March 15, 2002 4:52 PM >>>>To: [EMAIL PROTECTED] >>>>Subject: [Eap-list] 611 : 'false' error detected in xml >>>> >>>>This xml doc (a soap message) : >>>> >>>><?xml version="1.0" encoding="UTF-8"?> >>>><SOAP-ENV:Envelope >>>> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" >>>> xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" >>>> xmlns:xsd="http://www.w3.org/2001/XMLSchema" >>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >>>> xmlns:ns0="capeconnect:Perf:PerfTest" >>>> >>>> >>>> >>>SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> >>> >>>> <SOAP-ENV:Body> >>>> <ns0:echoString> >>>> <arg0 xsi:type="xsd:string">Hello</arg0> >>>> <arg1 xsi:type="xsd:long">700</arg1> >>>> </ns0:echoString> >>>> </SOAP-ENV:Body> >>>></SOAP-ENV:Envelope> >>>> >>>>Is shown as erroneous by idea #611 - which tries to resolve the URN >>>> >>>> >>>for >>> >>> >>>>xmlns:ns0 as a URL. >>>>IDEA should not assume al namespaces are declared with >>>> > known-protocol > >>>>URLs. >>>> >>>>Edo >>>>--- >>>>Edoardo Comar >>>>Cape Clear Software >>>> >>>>NEW CapeStudio 3, out now >>>>Design, develop, integrate & deploy Web Services >>>>http://www.capeclear.com/download >>>> >>>> >>>>_______________________________________________ >>>>Eap-list mailing list >>>>[EMAIL PROTECTED] >>>>http://www.intellij.com/mailman/listinfo/eap-list >>>> >>>> >>> >>>_______________________________________________ >>>Eap-list mailing list >>>[EMAIL PROTECTED] >>>http://www.intellij.com/mailman/listinfo/eap-list >>> >>> >>> >> >> >>_______________________________________________ >>Eap-list mailing list >>[EMAIL PROTECTED] >>http://www.intellij.com/mailman/listinfo/eap-list >> > > > _______________________________________________ > Eap-list mailing list > [EMAIL PROTECTED] > http://www.intellij.com/mailman/listinfo/eap-list > > _______________________________________________ Eap-list mailing list [EMAIL PROTECTED] http://www.intellij.com/mailman/listinfo/eap-list
