- Processing XML documents with Oracle JDeveloper 11g
- Deepak Vohra
- 406字
- 2021-08-06 17:22:08
JDeveloper built-in schema validation
Oracle JDeveloper 11g has built-in support for XML schema validation. If an XML document includes a reference to an XML schema, the XML document may be validated with the XML schema using the built-in feature. An XML schema may be specified in an XML document using the xsi:noNamespaceSchemaLocation
attribute or the xsi:namespaceSchemaLocation
attribute. Before we discuss when to use which attribute, we need to define the target namespace. A schema is a collection of type definitions and element declarations whose names belong to a particular namespace called a target namespace. Thus, a target namespace distinguishes between type definitions and element declarations from different collections. An XML schema doesn't need to have a target namespace. If the XML schema has a target namespace, specify the schema's location in an XML document using the xsi:namespaceSchemaLocation
attribute. If the XML schema does not have a target namespace, specify the schema location using the xsi:noNamespaceSchemaLocation
attribute. The xsi:noNamespaceSchemaLocation
and xsi:namespaceSchemaLocation
attributes are a hint to the processor about the location of an XML schema document. Taking the example XML schema catalog.xsd
and the example XML document, catalog.xml
from the previous chapter, specify the XML schema location in the XML document using the following attribute declaration:
xsi:noNamespaceSchemaLocation="catalog.xsd"
The XML schema may be in any directory. The example XML document does not include any namespace elements. Therefore, the schema is specified with the xsi:noNamespaceSchemaLocation
attribute in the root element catalog. The XML schema may be specified with a relative URL, or a file, or an HTTP URL. The xsi:noNamespaceSchemaLocation
attribute we added specifies the relative path to the XML schema document catalog.xsd
. To validate the XML document with the XML schema, right-click on the XML document and select Validate XML.

The XML document gets validated with the XML schema and the output indicates that the XML document does not have any validation errors.

To demonstrate validation errors, add a non-valid element to the XML document. As an example, add the following element to the catalog
element after the first journal
element:
<article></article>
To validate the modified XML document, right-click on the XML document and select Validate XML. The output indicates validation errors. All the elements after the non-valid element become non-valid. For example, the journal
element is valid as a subelement of the catalog
element, but because the second journal
element is after the non-valid article
element, the journal
element also becomes non-valid as indicated in the validation output.

- Excel 2010 商務數據分析與處理(第2版)
- 青少年美育趣味課堂:青少年學攝影修圖
- After Effects CC 2019 影視后期特效合成案例教程
- 中文版AutoCAD基礎培訓教程
- Final Cut Pro短視頻剪輯入門教程
- PS App UI設計從零開始學
- SolidWorks 2018有限元:運動仿真與流場分析自學手冊
- AutoCAD 2022中文版建筑設計從入門到精通
- 新印象:CINEMA 4D電商設計基礎與實戰(全視頻微課版)
- Python 3 Object Oriented Programming
- Excel 2013公式·函數與數據分析
- PPT設計與制作實戰教程
- 3ds Max影視動畫角色設計技法教程
- Photoshop+CorelDRAW平面設計實例教程(第3版)
- 夢幻森林Procreate童話風插畫繪制專業技法