Altova XMLSpy 2025 Professional Edition

icSchemaSettings

The Schema Design | Schema Settings command is enabled in Schema View and lets you define global settings for the active schema. These settings are the attributes of the xs:schema element.

dlgSchemaSettings

The settings defined in the Schema Settings dialog above (when XSD mode is set to 1.1) will create the following xs:schema element.

 

<xs:schema xmlns="https://www.altova.com/schemas/org"

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

          xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning"

          targetNamespace="https://www.altova.com/schemas/org"

          elementFormDefault="qualified"

          xpathDefaultNamespace="##targetNamespace"

          version="1.1"

          defaultAttributes="Contact"

          vc:minVersion="1.1">

 

Note the following points:

 

What's in the Schema Settings dialog will differ according to the active XSD mode. If XSD 1.0 is the active mode, then XSD 1.1 attributes are not present in the dialog.

In XSD 1.1 mode, the attribute vc:minVersion="1.1" must be present on the xs:schema element.

The defaultAttributes and xpathDefaultNamespace attributes are XML Schema 1.1 features and will be available only in XSD 1.1 mode. They can be present in XSD 1.1.

The other attributes are available in both XSD 1.0 and XSD 1.1.

 

The version attribute

The version attribute is the document version. It is not the XSD version of the document.

 

 

The defaultAttributes attribute

The defaultAttributes attribute enables you to select an attribute group as the default attribute group of all complex types in the schema.

 

The default attribute group will be displayed in the content model of these complex types. In the screenshot below, for example, the group element has complex content. As a result, the Contact attribute group, which was set as the default attribute group of all complex types in the schema (see screenshot above where this has been set), is automatically available on the group element. If you want to disable the default attribute group on a particular complex type, then you must set the complex type's defaultAttributesApply attribute to false. In Schema View, you can do this via the defAttrs property in the Details entry helper of the complex type (see screenshot below).

SchemaSettingsDefAttr

 

The xpathDefaultNamespace attribute

The xpathDefaultNamespace attribute sets the default namespace for elements in XPath expressions used in the schema. If set in the Schema Settings dialog, the attribute is applied to the top-level xs:schema element. So the scope of the declaration will be the entire document. You can override the declaration on xs:schema with declarations on elements where the attribute is allowed:

 

xs:assert and xs:assertion

xs:alternative

xs:selector and xs:field (in identity constraints)

 

You can change the XPath default namespace in the Details entry helper of the elements listed above.

 

The xpathDefaultNamespace attribute can have one of three allowed values:

 

##targetNamespace: The XPath default namespace will be the same as the target namespace of the schema

##defaultNamespace: The XPath default namespace will be the same as the default namespace of the schema

##local: There is no XPath default namespace

 

If no XPath default namespace is declared in the document, unprefixed elements in XPath expressions will be in no namespace. The XPath default namespace declaration does not apply to attributes.

 

© 2018-2024 Altova GmbH