Import XSD for namespace http://www.w3.org/2001/XMLSchema?

When referencing definitions in another XSD, we use "import" for another XSD that is in a different namespace, and use "include" for another XSD that is in the same namespace.

However, we don't need to import xmlns:xsd="http://www.w3.org/2001/XMLSchema

before using it. What for? I wonder how the XSD schema became available to the application --- which file contains this XSD? Is it because it is already in the application class?

Likewise, I'm wondering if we need to import or include if another schema we created would be in the application classpath?

+3


source to share


1 answer


A xmlns:xsd="http://www.w3.org/2001/XMLSchema

namespace declaration associates a namespace prefix with a xsd

namespace http://www.w3.org/2001/XMLSchema

URI . This special namespace defines the vocabulary used in the XML schema; it is not associated with custom XSDs introduced via xsd:import

and xsd:include

.

Related : There is an XML Schema v1.0 (or v1.1 ) that can be used to validate an XSD, but XSD processors can have their own validation methods and do not need to be read in the XML Schema.

... Connected . Ads xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance

connects xsi

with a namespace http://www.w3.org/2001/XMLSchema-instance

for several attributes defined by the XML specification: xsi:type

, xsi:nil

, xsi:schemaLocation

, andxsi:noNamespaceSchemaLocation



None of these need to be imported or enabled by the user.

Yes, the XSD must explicitly import or include all other XSDs that contain the required components; there is no automatic import or inclusion of these XSDs associated with any type of classpath.

+2


source







All Articles