D 非推奨となったXML変換の構造体
XML変換をサポートするOracle構造体について説明します。これらは、Oracle Database 12c リリース1 (12.1.0.1)から非推奨となりました。
- XML変換(非推奨)
非推奨のXML変換のOracleサポートを使用して、Oracle XML DBリポジトリ内のXMLType
文書に含まれる文字列を様々な(自然)言語に変換できます。 - PL/SQLパッケージDBMS_XMLTRANSLATIONS (非推奨)
Oracle XML DBでは、DBMS_XMLTRANSLATIONS
パッケージを使用して変換サポートが提供されています。このパッケージは変換を実行するインタフェースを提供し、様々な言語での検索や表示を可能にしています。この機能は非推奨になっています。
親トピック: 付録
D.1 XML変換(非推奨)
非推奨のXML変換のOracleサポートを使用して、Oracle XML DBリポジトリ内のXMLType
文書に含まれる文字列を様々な(自然)言語に変換できます。
Oracle XML DBリポジトリ内のXML文書をXMLType
インスタンスとして格納できます。これらの文書には、様々な(自然)言語に翻訳しなければならない文字列が含まれている場合があります。非推奨となったOracle XML変換のサポートを利用するには、元の文字列と変換結果の両方をリポジトリに格納します。ユーザーの言語設定に応じて、これらの文字列を取得および操作できます。
注意:
オブジェクト・リレーショナル形式で格納されたXML Schemaは変換できません。
- 変換のためのXML SchemaとXMLインスタンス・ドキュメントの変更(非推奨)
XML Schemaおよび関連するXMLインスタンス・ドキュメントに特定の変更を加えて、このドキュメントを変換できるようにする必要があります。 - XML文書を変換可能にする方法(非推奨)
非推奨の変換を指定するXML Schema属性を使用して、サンプル・ドキュメント内の要素を変換できるようにすることができます。 - 変換済のドキュメントに対する操作(非推奨)
変換済のドキュメントに対して、挿入、問合せおよび更新の操作を実行できます。言語情報があるドキュメントおよび言語情報がないドキュメントの挿入の例を示します。
親トピック: 非推奨となったXML変換の構造体
D.1.1 変換のためのXML SchemaとXMLインスタンス・ドキュメントの変更(非推奨)
XML Schemaおよび関連するXMLインスタンス・ドキュメントに特定の変更を加えて、このドキュメントを変換できるようにする必要があります。
- XML Schema内での変換可能な要素の指示(非推奨)
XML Schema内で、変換する要素ごとに属性xdb:translate
を指定する必要があります。属性xdb:translate
には、いくつかの制限が適用されます。XML Schemaの登録時に、PL/SQLプロシージャDBMS_XMLSCHEMA.registerSchema
は、XML Schemaがこれらの制限を満たしているかを確認します。 - XMLインスタンス・ドキュメント内での変換言語属性の指示(非推奨)
変換言語属性xml:lang
およびxdb:srclang
のサポートについて説明します。
親トピック: 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
およびxdb: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:translate
をtrue
に設定します。これは、単一値要素(xdb:maxOccurs
が1
)です。例D-3は、属性xdb:translate
がtrue
に設定されている新規のXML Schemaを示します。
例D-4は、タイトル・テキストを変換した後のインスタンス・ドキュメントを示します。
複数値要素の場合にタイトルを変換可能にするには、xdb:maxOccurs
をunbounded
に設定します。ただし、xdb:translate
は、各要素を一意に識別する識別子属性がないかぎり、複数値要素用にtrue
に設定できません。例D-5は、title
要素に識別子属性id
を使用する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>
親トピック: XML変換(非推奨)
D.1.3 変換済のドキュメントに対する操作(非推奨)
変換済のドキュメントに対して、挿入、問合せおよび更新の操作を実行できます。言語情報があるドキュメントおよび言語情報がないドキュメントの挿入の例を示します。
-
挿入: 変換をサポートするXML Schemaにドキュメントが準拠する場合は、それをOracle XML DBに挿入できます。変換を含むドキュメントに対しては、言語情報を提供するか、セッション言語変換を使用できます。
-
ドキュメントに言語情報が含まれず、属性
xml:lang
が設定されていない場合、変換にはセッション言語が使用されます。例D-7は、セッション言語が日本語のドキュメントを表します。属性xml:lang
はsession language
に設定され、属性xdb:srclang
はtrue
に設定されています。例D-8は、Oracle XML DBリポジトリに挿入された後のドキュメントを示します。
-
言語情報を提供すると、明示的に言語を
xdb:srclang=true
とマークするか、属性xdb:srclang
の中のセッション言語を使用して、属性xml:lang
が設定されます。いずれも行わないと、任意の変換が選択され、xdb:srclang
がtrue
に設定されます。例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:srclang
がtrue
の言語と同じです。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.enableTranslation
、DBMS_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>
親トピック: XML変換(非推奨)
D.2 PL/SQLパッケージDBMS_XMLTRANSLATIONS (非推奨)
Oracle XML DBでは、DBMS_XMLTRANSLATIONS
パッケージを使用して変換サポートが提供されています。このパッケージは変換を実行するインタフェースを提供し、様々な言語での検索や表示を可能にしています。この機能は非推奨になっています。
- DBMS_XMLTRANSLATIONSメソッド(非推奨)
非推奨のPL/SQLパッケージDBMS_XMLTRANSLATIONS
には、メソッドupdateTranslation
、setSourceLang
、translateXML
、getBaseDocument
、extractXLiff
、mergeXLiff
、disableTranslation
およびenableTranslation
が用意されています。
関連項目:
XML変換の概要は、XML Schemaの格納と問合せ: 基本を参照してください。
親トピック: 非推奨となったXML変換の構造体
D.2.1 DBMS_XMLTRANSLATIONSメソッド(非推奨)
非推奨のPL/SQLパッケージDBMS_XMLTRANSLATIONS
には、メソッドupdateTranslation
、setSourceLang
、translateXML
、getBaseDocument
、extractXLiff
、mergeXLiff
、disableTranslation
および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パッケージおよびタイプ・リファレンスを参照してください。