プライマリ・コンテンツに移動
Oracle® XML DB開発者ガイド
12cリリース1 (12.1)
B71282-04
目次へ移動
目次
索引へ移動
索引

前
次

D 非推奨となったXML変換の構造体

XML変換をサポートするOracle構造体について説明します。これらは、Oracle Database 12c リリース1 (12.1.0.1)から非推奨となりました。

D.1 XML変換(非推奨)

非推奨のXML変換のOracleサポートを使用して、Oracle XML DBリポジトリ内のXMLType文書に含まれる文字列を様々な(自然)言語に変換できます。

Oracle XML DBリポジトリ内のXML文書をXMLTypeインスタンスとして格納できます。これらの文書には、様々な(自然)言語に翻訳しなければならない文字列が含まれている場合があります。非推奨となったOracle XML変換のサポートを利用するには、元の文字列と変換結果の両方をリポジトリに格納します。ユーザーの言語設定に応じて、これらの文字列を取得および操作できます。

注意:

オブジェクト・リレーショナル形式で格納されたXML Schemaは変換できません。

D.1.1 変換のためのXML SchemaとXMLインスタンス・ドキュメントの変更(非推奨)

XML Schemaおよび関連するXMLインスタンス・ドキュメントに特定の変更を加えて、このドキュメントを変換できるようにする必要があります。

D.1.1.1 XML Schema内での変換可能な要素の指示(非推奨)

XML Schema内で、変換する要素ごとに属性xdb:translateを指定する必要があります。属性xdb:translateには、いくつかの制限が適用されます。XML Schemaの登録時に、PL/SQLプロシージャDBMS_XMLSCHEMA.registerSchemaは、XML Schemaがこれらの制限を満たしているかを確認します。

  • 属性xdb:translateは、simpleContentを持つcomplexType要素にのみ指定できます。ここで、simpleContentは、string型の拡張または制限である必要があります。ただし、complexType要素にxdb:translateフラグが設定されている場合、その子孫にはこのフラグを設定できません。

  • 属性xdb:translateは、単一値要素(1つだけの変換を持つ要素)にのみ設定できます。このような要素では、xdb:maxOccursの値を0または1に設定する必要があります。この属性を複数値要素に設定する場合、要素を一意に識別するID属性を要素が持つ必要があります。

D.1.1.2 XMLインスタンス・ドキュメント内での変換言語属性の指示(非推奨)

変換言語属性xml:langおよびxml:srclangのサポートについて説明します。

  • xml:lang: 変換をサポートするXML Schemaに関連付けられたインスタンス・ドキュメントには、変換言語を指定する必要があります。これは、変換のたびに属性xml:langを使用して注釈を付けることで指定できます。属性xml:langで使用できる値は、IETF RFC 3066で識別される言語識別子です。

  • xdb:srclang: 複数値要素、つまり、複数の変換を持つことができる要素には、1つの変換のみをソース言語変換として使用できます。この変換は、属性xdb:srclangによって指定されます。これは、セッション言語が指定されていない場合に戻されるデフォルトの変換です。

D.1.2 XML文書を変換可能にする方法(非推奨)

非推奨の変換を指定するXML Schema属性を使用して、サンプル・ドキュメント内の要素を変換できるようにすることができます。

例D-1は、変換可能でなければならないタイトル文字列を含むドキュメントを定義するXML Schemaを示します。

例D-2は、例D-1のXML Schemaに関連付けられるドキュメントを示します。

最上位のタイトルを変換可能にするには、xdb:translatetrueに設定します。これは、単一値要素(xdb:maxOccurs1)です。例D-3は、属性xdb:translatetrueに設定されている新規のXML Schemaを示します。

例D-4は、タイトル・テキストを変換した後のインスタンス・ドキュメントを示します。

複数値要素の場合にタイトルを変換可能にするには、xdb:maxOccursunboundedに設定します。ただし、xdb:translateは、各要素を一意に識別する識別子属性がないかぎり、複数値要素用にtrueに設定できません。例D-5は、title要素に識別子属性idを使用するXML Schemaを示します。

例D-6は、例D-5のXML Schemaに関連付けられたドキュメントを示します。

例D-1 変換の必要があるタイトルを含むドキュメントを定義するXML Schema

<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:xdbsc="http://xmlns.oracle.com/xdb/security.xsd"
        xmlns:xdb="http://xmlns.oracle.com/xdb.xsd"
        targetNamespace="http://xmlns.oracle.com/xdb/security.xsd"
        elementFormDefault="qualified" version="1.0">
  <annotation>
    <documentation>
This XML schema describes the structure of Security Class documents.
    </documentation>
  </annotation>
  <element name="securityClass" xdb:defaultTable="">
    <complexType>
      <sequence>
        <element name="name" type="string"/>
        <element name="title" minOccurs="0" maxOccurs="unbounded"/>
        <element name="inherits-from" type="QName" minOccurs="0" maxOccurs="unbounded"/>
        <element name="privlist" minOccurs="0" maxOccurs="unbounded">
          <complexType>
            <choice minOccurs="0" maxOccurs="unbounded">
              <element ref="xdbsc:privilege"/>
                <element ref="xdbsc:aggregatePrivilege"/>
            </choice>
          </complexType>
        </element>
        <!-- this "any" contains all application specific information
             for a security class in general e.g. reason for creation  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="targetNamespace" type="anyURI" use="required"/>
      <!-- all privileges in this security class are under this target namespace -->
    </complexType>
  </element>
  <element name="aggregatePrivilege">
    <complexType>
      <sequence>
        <element name="title" minOccurs="0" maxOccurs="unbounded"/>
        <sequence maxOccurs="unbounded">
          <element name="privilegeRef">
            <complexType>
              <attribute name="name" type="QName" use="required"/>
            </complexType>
          </element>
          <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <!-- this "any" contains all application specific information   
             an aggregate privilege e.g. translations  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="name" type="string" use="required"/>
    </complexType>
  </element>
  <element name="privilege">
    <complexType>
      <sequence minOccurs="0">
        <element name="title" minOccurs="0" maxOccurs="unbounded"/>
        <sequence minOccurs="0" maxOccurs="unbounded">
          <element name="columnRef">
            <complexType>
              <attribute name="schema" type="string" use="required"/>
              <attribute name="table" type="string" use="required"/>
              <attribute name="column" type="string" use="required"/>
            </complexType>
          </element>
          <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <!-- this "any" contains all application specific information   
             for a privilege e.g. translations  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="name" type="string" use="required"/>
    </complexType>
  </element>
</schema>

例D-2 変換されていないインスタンス・ドキュメント

<securityClass xmlns="http://xmlns.oracle.com/xdb/security.xsd"
               xmlns:is="xmlns.oracle.com/iStore"
               xmlns:oa="xmlns.oracle.com/OracleApps"
               targetNamespace="xmlns.oracle.com/example">
  <name>
securityClassExample
  </name>
  <title>
Security Class Example
  </title>
  <inherits-from>is:iStorePurchaseOrder</inherits-from>
  <privlist>
  <privilege name="privilege1"/>
  <aggregatePrivilege name="iStorePOApprover">
    <title>
iStore Purchase Order Approver
    </title>
    <privilegeRef name="is:privilege1"/>
    <privilegeRef name="oa:submitPO"/>
    <privilegeRef name="oa:privilege3"/>
  </aggregatePrivilege>
  <privilege name="privilege2">
    <title>
secondary privilege
    </title>
    <columnRef schema="APPS" table="PurchaseOrder" column="POId"/>
    <columnRef schema="APPS" table="PurchaseOrder" column="Amount"/>
  </privilege>
  </privlist>
</securityClass>

例D-3 単一値要素の属性xdb:translateを含むXML Schema

<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:xdbsc="http://xmlns.oracle.com/xdb/security.xsd"
        xmlns:xdb="http://xmlns.oracle.com/xdb.xsd"
        targetNamespace="http://xmlns.oracle.com/xdb/security.xsd"
        elementFormDefault="qualified" version="1.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
        schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<xs:import namespace-"http://xmlns.oracle.com/xdb"
        schemaLocation="http://xmlns.oracle.com/xdb/xmltr.xsd"/>
  <annotation>
    <documentation>
This XML schema describes the structure of Security Class documents.
    </documentation>
  </annotation>
  <element name="securityClass" xdb:defaultTable="">
    <complexType>
      <sequence>
        <element name="name" type="string"/>
        <element ref="titleref" minOccurs="0" maxOccurs="unbounded"
                 xdb:maxOccurs="1" xdb:translate="true"/>
        <element name="inherits-from" type="QName" minOccurs="0" maxOccurs="unbounded"/>
        <element name="privlist" minOccurs="0" maxOccurs="unbounded" xdb:maxOccurs="1">
          <complexType>
            <choice minOccurs="0" maxOccurs="unbounded">
              <element ref="xdbsc:privilege"/>
              <element ref="xdbsc:aggregatePrivilege"/>
            </choice>
          </complexType>
        </element>
        <!-- this "any" contains all application specific information
             for a security class in general e.g. reason for creation  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="targetNamespace" type="anyURI" use="required"/>
      <!-- all privileges in this security class are under this target namespace -->
    </complexType>
  </element>
  <element name="aggregatePrivilege">
    <complexType>
      <sequence>
        <element name="title" minOccurs="0" maxOccurs="unbounded"/>
        <sequence maxOccurs="unbounded">
          <element name="privilegeRef">
            <complexType>
              <attribute name="name" type="QName" use="required"/>
            </complexType>
          </element>
          <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <!-- this "any" contains all application specific information   
             an aggregate privilege e.g. translations  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="name" type="string" use="required"/>
    </complexType>
  </element>
  <element name="privilege">
    <complexType>
      <sequence minOccurs="0">
        <element name="title" minOccurs="0" maxOccurs="unbounded"/>
        <sequence minOccurs="0" maxOccurs="unbounded">
          <element name="columnRef">
            <complexType>
              <attribute name="schema" type="string" use="required"/>
              <attribute name="table" type="string" use="required"/>
              <attribute name="column" type="string" use="required"/>
            </complexType>
          </element>
          <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <!-- this "any" contains all application specific information   
             for a privilege e.g. translations  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="name" type="string" use="required"/>
    </complexType>
  </element>
  <element name="titleref">
    <complexType>
      <simpleContent>
        <extension base="xs:string">
          <attribute ref="xml:lang"/>
          <attribute ref="xdb:srclang"/>
        </extension>
      </simpleContent>
    </complexType>
  </element>
</schema>

例D-4 変換後のドキュメント

<securityClass xmlns="http://xmlns.oracle.com/xdb/security.xsd"
               xmlns:is="xmlns.oracle.com/iStore"
               xmlns:oa="xmlns.oracle.com/OracleApps">
  <name>
securityClassExample
  </name>
  <title xml:lang="en" xdb:srclang="true">
Security Class Example
  </title>
  <title xml:lang="es">
Security Class Example - Spanish
  </title>
  <title xml:lang="fr">
Security Class Example - French
  </title>    
  <inherits-from>is:iStorePurchaseOrder</inherits-from>
  <privlist>
    <privilege name="privilege1"/>
    <aggregatePrivilege name="iStorePOApprover">
      <title>
iStore Purchase Order Approver
      </title>
      <privilegeRef name="is:privilege1"/>
      <privilegeRef name="oa:submitPO"/>
      <privilegeRef name="oa:privilege3"/>
    </aggregatePrivilege>
    <privilege name="privilege2">
      <title>
secondary privilege
      </title>
      <columnRef schema="APPS" table="PurchaseOrder" column="POId"/>
      <columnRef schema="APPS" table="PurchaseOrder" column="Amount"/>
    </privilege>
  </privlist>
</securityClass>

例D-5 複数値要素の属性xdb:translateを含むXML Schema

<schema xmlns="http://www.w3.org/2001/XMLSchema"
        xmlns:xdbsc="http://xmlns.oracle.com/xdb/security.xsd"
        xmlns:xdb="http://xmlns.oracle.com/xdb.xsd"
        targetNamespace="http://xmlns.oracle.com/xdb/security.xsd"
        elementFormDefault="qualified" version="1.0">
<xs:import namespace="http://www.w3.org/XML/1998/namespace"
        schemaLocation="http://www.w3.org/2001/xml.xsd"/>
<xs:import namespace-"http://xmlns.oracle.com/xdb"
        schemaLocation="http://xmlns.oracle.com/xdb/xmltr.xsd"/>
  <annotation>
    <documentation>
This XML schema describes the structure of Security Class documents.
    </documentation>
  </annotation>
  <element name="securityClass" xdb:defaultTable="">
    <complexType>
      <sequence>
        <element name="name" type="string"/>
        <element name="title" minOccurs="0" maxOccurs="unbounded" xdb:maxOccurs="1"/>
        <element name="inherits-from" type="QName" minOccurs="0" maxOccurs="unbounded"/>
        <element name="privlist" minOccurs="0" maxOccurs="unbounded" xdb:maxOccurs="1">
          <complexType>
            <choice minOccurs="0" maxOccurs="unbounded">
              <element ref="xdbsc:privilege"/>
              <element ref="xdbsc:aggregatePrivilege"/>
            </choice>
          </complexType>
        </element>
        <!-- this "any" contains all application specific information
             for a security class in general e.g. reason for creation  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="targetNamespace" type="anyURI" use="required"/>
      <!-- all privileges in this security class are under this target namespace -->
    </complexType>
  </element>
  <element name="aggregatePrivilege">
    <complexType>
      <sequence>
        <element name="titleref" minOccurs="0" maxOccurs="unbounded"
                 xdb:maxOccurs="unbounded" xdb:translate="true"/>
        <sequence maxOccurs="unbounded">
          <element name="privilegeRef">
            <complexType>
              <attribute name="name" type="QName" use="required"/>
            </complexType>
          </element>
          <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <!-- this "any" contains all application specific information   
             an aggregate privilege e.g. translations  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="name" type="string" use="required"/>
    </complexType>
  </element>
  <element name="privilege">
    <complexType>
      <sequence minOccurs="0">
        <element name="titleref" minOccurs="0" maxOccurs="unbounded"
                 xdb:maxOccurs="unbounded" xdb:translate="true"/>
        <sequence minOccurs="0" maxOccurs="unbounded">
          <element name="columnRef">
            <complexType>
              <attribute name="schema" type="string" use="required"/>
              <attribute name="table" type="string" use="required"/>
              <attribute name="column" type="string" use="required"/>
            </complexType>
          </element>
          <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <!-- this "any" contains all application specific information   
             for a privilege e.g. translations  -->
        <any namespace="##other" minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
      <attribute name="name" type="string" use="required"/>
    </complexType>
  </element>
  <element name="titleref">
    <complexType>
      <simpleContent>
        <extension base="xs:string">
          <attribute ref="xml:lang"/>
          <attribute ref="xdb:srclang"/>
          <attribute name="id" type="integer"/>
        </extension>
      </simpleContent>
    </complexType>
  </element>
</schema>

例D-6 複数値要素を持つXML Schemaの変換済ドキュメント

<securityClass xmlns="http://xmlns.oracle.com/xdb/security.xsd"
               xmlns:is="xmlns.oracle.com/iStore"
               xmlns:oa="xmlns.oracle.com/OracleApps">
  <name>
securityClassExample
  </name>
  <title>
Security Class Example
  </title>
  <inherits-from>is:iStorePurchaseOrder</inherits-from>
  <privlist>
    <privilege name="privilege1"/>
    <aggregatePrivilege name="iStorePOApprover">
      <title>
iStore Purchase Order Approver
      </title>
      <privilegeRef name="is:privilege1"/>
      <privilegeRef name="oa:submitPO"/>
      <privilegeRef name="oa:privilege3"/>
    </aggregatePrivilege>
    <privilege name="privilege2">
      <title id="2" xml:lang="en" xdb:srclang="true">
secondary privilege - english
      </title>
      <title id="1" xml:lang="fr">
primary privilege - french
      </title>
      <title id="1" xml:lang="en" xdb:srclang="true">
primary privilege - english
      </title>       
      <columnRef schema="APPS" table="PurchaseOrder" column="POId"/>
      <columnRef schema="APPS" table="PurchaseOrder" column="Amount"/>
    </privilege>
  </privlist>
</securityClass>

D.1.3 変換済のドキュメントに対する操作(非推奨)

変換済のドキュメントに対して、挿入、問合せおよび更新の操作を実行できます。言語情報があるドキュメントおよび言語情報がないドキュメントの挿入の例を示します。

  • 挿入: 変換をサポートするXML Schemaにドキュメントが準拠する場合は、それをOracle XML DBに挿入できます。変換を含むドキュメントに対しては、言語情報を提供するか、セッション言語変換を使用できます。

    • ドキュメントに言語情報が含まれず、属性xml:langが設定されていない場合、変換にはセッション言語が使用されます。例D-7は、セッション言語が日本語のドキュメントを表します。属性xml:langsession languageに設定され、属性xdb:srclangtrueに設定されています。

      例D-8は、Oracle XML DBリポジトリに挿入された後のドキュメントを示します。

    • 言語情報を提供すると、明示的に言語をxdb:srclang=trueとマークするか、属性xdb:srclangの中のセッション言語を使用して、属性xml:langが設定されます。いずれも行わないと、任意の変換が選択され、xdb:srclangtrueに設定されます。

      例D-9は、セッション言語が日本語のドキュメントを表します。

      例D-10は、Oracle XML DBリポジトリに挿入された後のドキュメントを示します。

  • 問合せ: 変換された要素を伴うノードを問い合せる場合、問合せは変換のデフォルト動作を表示します。問合せの結果に変換のデフォルト動作が適用されるように指定するには、Oracle Xpath関数ora:translateを使用する必要があります。関数の構文は次のとおりです。

    Nodeset ora:translate(Nodeset parent, String childname, String childnsp)
    

    パラメータparentは、変換済ノードを検索する先の親ノードです。childnameは子ノード名で、childnspは子ノードの名前空間のURLです。

    関数ora:translateは、親ノードの名前が指定した子ノードの名前と一致する場合に正の整数を戻し、xml:langの値は、セッション言語またはxdb:srclangtrueの言語と同じです。

    XMLQueryなどのSQL関数が変換済のドキュメントに適用されると、セッション言語変換が存在する場合はそれが戻され、存在しない場合はソース言語変換が戻されます。たとえば、次の問合せは、セッション言語変換を戻します。

    SELECT XMLQuery('$x/ora:translate(securityClass, "title")'
                    PASSING x.OBJECT_VALUE AS "x" RETURNING CONTENT)
      FROM some_table x;
    

    問合せの出力結果は次のとおりです。

    <title xml:lang="fr">
    Security Class Example - FR
    </title>
    

    特定の言語で結果を取得するには、その言語をXPath式の中で指定します。

    SELECT XMLQuery('$x/securityClass/title[@xml:lang="en"]'
                    PASSING x.OBJECT_VALUE AS "x" RETURNING CONTENT)
      FROM some_table x;
    

    問合せの出力結果は次のとおりです。

    <title xml:lang="en" xdb:srclang="true">
    Security Class Example
    </title>
    

    変換済のドキュメントは、テキスト(CLOB)またはバイナリXMLでのみ格納できるため、機能上の評価およびファンクション索引XMLIndex、またはCONTEXT索引を使用した問合せのみが可能です。XMLIndex 索引とCONTEXT索引の問合せすべてに対して、ドキュメントにセッション言語変換が存在する場合はそれが戻され、存在しない場合はソース言語変換が戻されます。ただし、ファンクション索引を使用した問合せの場合は、索引を使用するすべての言語について、明示的なxml:lang述語を持つ索引を作成する必要があります。

    SQL関数XMLSerializeおよびPL/SQLコンストラクタXDBURITypeを使用して完全なドキュメントを取得する場合は、セッション言語変換に一致する変換のみが戻されます。プロトコルに対しては、言語のプリファレンスを設定でき、ドキュメントはその言語でのみ戻されます。

    次のPL/SQLプロシージャおよび関数は、XML変換をサポートします。

    • DBMS_XMLTRANSLATIONS.translateXML: ドキュメントを指定した言語に変換します。指定した言語変換が存在する場合はそれが戻され、存在しない場合はソース言語変換が戻されます。

      たとえば、translateXML(doc, 'fr')と記述して例D-10の変換言語にフランス語を指定する場合、次のコードが戻され、他の変換はすべて無視されます。

      securityClass xmlns="http://xmlns.oracle.com/xdb/security.xsd"
                     xmlns:is="xmlns.oracle.com/iStore"
                     xmlns:oa="xmlns.oracle.com/OracleApps"
                     targetNamespace="xmlns.oracle.com/example">
          <name>
              securityClassExample
          </name>
          <title xml:lang="fr">
              Security Class Example - FR
          </title>
          <inherits-from>is:iStorePurchaseOrder</inherits-from>
      </securityClass>
      
    • DBMS_XMLTRANSLATIONS.enableTranslationDBMS_XMLTRANSLATIONS.disableTranslation: セッション・レベルで変換の有効化/無効化を行います。問合せは、変換が無効な場合は主ドキュメントに作用し、有効な場合は変換済ドキュメントに作用します。

    • DBMS_XMLTRANSLATIONS.getBaseDocument: すべての変換とともに完全なドキュメントを戻します。

  • 更新: Oracle SQL関数XMLQueryをXQuery Updateとともに使用して変換済のノードを更新します。ただし、変換言語を指定せずに変換済ノードを更新しようとした場合、エラーが発生します。次のPL/SQLプロシージャは、変換済のドキュメントへの更新操作をサポートします。

    • DBMS_XMLTRANSLATIONS.updateTranslation: この関数は、指定したxpathにある変換を特定の言語で更新します。特定の言語での変換が存在しない場合は、それが挿入されます。

    • DBMS_XMLTRANSLATIONS.setSourceLang: このプロシージャは、指定したxpathにあるソース言語を指定した言語に設定します。

例D-7 言語情報のないドキュメントの挿入

<securityClass xmlns="http://xmlns.oracle.com/xdb/security.xsd"
               xmlns:is="xmlns.oracle.com/iStore"
               xmlns:oa="xmlns.oracle.com/OracleApps"
               targetNamespace="xmlns.oracle.com/example">
  <name>
securityClassExample
  </name>
  <title>
Security Class Example
  </title>
  <inherits-from>is:iStorePurchaseOrder</inherits-from>
</securityClass>

例D-8 リポジトリに挿入された後のドキュメント

<securityClass xmlns="http://xmlns.oracle.com/xdb/security.xsd"
               xmlns:is="xmlns.oracle.com/iStore"
               xmlns:oa="xmlns.oracle.com/OracleApps"
               targetNamespace="xmlns.oracle.com/example">
  <name>
securityClassExample
  </name>
  <title xml:lang="jp" xdb:srclang="true">
Security Class Example
  </title>
  <inherits-from>is:iStorePurchaseOrder</inherits-from>
</securityClass>

例D-9 言語情報を持つドキュメントの挿入

<securityClass xmlns="http://xmlns.oracle.com/xdb/security.xsd"
               xmlns:is="xmlns.oracle.com/iStore"
               xmlns:oa="xmlns.oracle.com/OracleApps"
               targetNamespace="xmlns.oracle.com/example">
  <name>
securityClassExample
  </name>
  <title xml:lang="en">
Security Class Example
  </title>
  <title xml:lang="fr">
Security Class Example - FR
  </title>
  <inherits-from>is:iStorePurchaseOrder</inherits-from>
</securityClass>

例D-10 挿入後のドキュメント

<securityClass xmlns="http://xmlns.oracle.com/xdb/security.xsd"
               xmlns:is="xmlns.oracle.com/iStore"
               xmlns:oa="xmlns.oracle.com/OracleApps"
               targetNamespace="xmlns.oracle.com/example">
  <name>
securityClassExample
  </name>
  <title xml:lang="en" xdb:srclang="true">
Security Class Example
  </title>
  <title xml:lang="fr">
Security Class Example - FR
  </title>
  <inherits-from>is:iStorePurchaseOrder</inherits-from>
</securityClass>

D.2 PL/SQLパッケージDBMS_XMLTRANSLATIONS (非推奨)

Oracle XML DBでは、DBMS_XMLTRANSLATIONSパッケージを使用して変換サポートが提供されています。このパッケージは変換を実行するインタフェースを提供し、様々な言語での検索や表示を可能にしています。この機能は非推奨になっています。

関連項目:

XML変換の概要は、XML Schemaの格納と問合せ: 基本を参照してください。

D.2.1 DBMS_XMLTRANSLATIONSメソッド(非推奨)

非推奨のPL/SQLパッケージDBMS_XMLTRANSLATIONSには、メソッドupdateTranslationsetSourceLangtranslateXMLgetBaseDocumentextractXLiffmergeXLiffdisableTranslationおよびenableTranslationが用意されています。

  • updateTranslation(): 指定されたXPATHにある、特定の言語での変換を更新します。その言語での変換が存在しない場合は、それが挿入されます。

  • setSourceLang(): ソース言語をXPATHにある、特定の言語に設定します。

  • translateXML(): 特定の言語で文書を戻します。

  • getBaseDocument(): 主ドキュメントをすべての変換とともに戻します。

  • extractXLiff(): XMLTYPEインスタンスまたはOracle XML DBリポジトリのリソースから変換をXLIFF形式で抽出します。

  • mergeXLiff: XMLTYPEインスタンスまたはOracle XML DBリポジトリのリソースに、変換をXLIFF形式でマージします。

  • disableTranslation: 現在のセッションで変換を無効にして、問合せまたは取出しが、セッションの言語値を無視して主ドキュメント上で行われるようにします。

  • enableTranslation: 現在のセッションで変換を有効にします。

関連項目:

DBMS_XMLTRANSLATIONSメソッドの説明は、『Oracle Database PL/SQLパッケージ・プロシージャおよびタイプ・リファレンス』を参照してください。