Error when using XJC with xml.xsd import: "Failed to read xml.xsd schema document"

I am trying to run xjc in third-party schema files (this is the Amazon.com API). Well, I have problems because with one of the default.xsd files, xjc works on the following import (it is the first immediately after the declaration of the scheme):

<import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="xml.xsd" />

I'm not an XML expert, but I thought that xml.xsd is part of the "core" XML / XSD library and that XJC will know the details of this library by default. But when I run the task, I get this error:

[WARNING] schema_reference.4: Could not read the schema document 'xml.xsd' because 1) the document could not be found; 2) the document cannot be read; 3) the root element of the document is not, line 9 of the file: / C: /temp/amazon/default.xsd

[ERROR] src-resolve: Unable to resolve the name "xml: lang" in the (n) component of the attribute attribute. line 119 File: / C: /temp/amazon/default.xsd

I tried to load the xml.xsd file from http://www.w3.org/2001/03/xml.xsd into the directory with these schema files and run the command again, but xml. xsd does not check:

[ERROR] schema_reference.4: Could not read the schema document 'file: / C: /temp/amazon/xml.xsd' because 1) the document could not be found; 2) the document cannot be read; 3) the root element of the document is missing. unknown location

I was about to start going down the rabbit hole, why this would not be verified, but decided to hold on, because I think that I have something really simple or small. Do I need to manually enable xml.xsd import, or am I missing something else?

URL- , , :

http://g-ecx.images-amazon.com/images/G/01/mwsportal/doc/en_US/products/default.xsd

http://g-ecx.images-amazon.com/images/G/01/mwsportal/doc/en_US/products/ProductsAPI_Response.xsd

:

xjc dirname xjc filename .

+4
2

XSD , , , , , .

, . , XML http://www.w3.org/XML/1998/namespace . , , xml.xsd Schema, XSD, .

, , XML xmlns:xml="http://www.w3.org/XML/1998/namespace" ( ), XJC , .

xjc -nv, . , :

[ERROR] :/D:/Projects/xyz/XMLSchema.dtd: java.io.FileNotFoundException: D:\Projects\xyz\XMLSchema.dtd( )    2 :/D:/Projects/xyz/xml.xsd

-, XJC DTD, DOCTYPE:

<!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" >

, XJC, XML-, XSD. XML , , DTD, , . , , XML-, XML , DTD, XML ( XML XML-, XSD, XML).

, DTD , XML . XMLSchma DTD , , , , -nv.

+1

:

  • , URL.
  • (, ) .
  • , URL. :
    PUBLIC "http://www.w3.org/XML/1998/namespace" "w3c/2001/03/xml.xsd"
    REWRITE_SYSTEM "http://www.w3.org/2001/03/xml.xsd" "w3c/2001/03/xml.xsd"
    ( w3c/2001/03/xml.xsd.)
  • xjc -catalog mycatalog.cat ...

DTD. "http://www.w3.org""w3c" , .

-nv - , :

:

+2

Source: https://habr.com/ru/post/1608393/


All Articles