如何选择在 Oracle 中注册的 XML 模式?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1941024/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I select an XML schema registered with Oracle?
提问by Brian Kent
How do I select an XML schema previously registered with Oracle?
如何选择以前在 Oracle 中注册的 XML 模式?
For example, if I've registered a schema like so:
例如,如果我注册了这样的架构:
DBMS_XMLSCHEMA.registerSchema(
SCHEMAURL => 'http://test.com/my-schema.xsd',
SCHEMADOC => '...the xsd...,
...
);
I would like to be able to get that schema back, ideally something in the vein of:
我希望能够恢复该模式,理想情况下是这样的:
select s.schemadoc
from magic_schema_table s
where s.schemaurl = 'http://test.com/my-schema.xsd'
Does such a mechanism exist?
这样的机制存在吗?
回答by Thomas Aregger
You can use the Datadictionary View ALL_XML_SCHEMAS.
您可以使用 Datadictionary 视图 ALL_XML_SCHEMAS。
SELECT SCHEMA
FROM ALL_XML_SCHEMAS
WHERE SCHEMA_URL = 'http://test.com/my-schema.xsd';
回答by dasilvj
You should find your answer there : XML Schema Storage and Query: Basic
您应该在那里找到答案:XML Schema Storage and Query: Basic
Update:
更新:
The only other thing that I can see which can help you would be to generate a schema for a given object type. Here is the way to go: Generating XML Schemas with DBMS_XMLSCHEMA.GENERATESCHEMA
我能看到的唯一可以帮助您的另一件事是为给定的对象类型生成模式。这是要走的路:使用 DBMS_XMLSCHEMA.GENERATESCHEMA 生成 XML 模式