| 我一直在研究达索公司旗下的 SmarTeam 软件,它是一个很好的PDM(产品数据管理)软件,它的最新版本是V5R17。在它的安装目录中有一个目录“ConfigurationSettings”,它包括2个子目录:分别是 Data 和 Schemas。 在DATA目录中有2个文件,分别是 namespaces.xml 和 namespaces.xsd ,它们的内容如下: |
| namespaces.xml |
|
<configNamespaces xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.smarteam.com/dev/ns/config/namespaces/1.0 http://www.smarteam.com/dev/schema/config/namespaces/1.0/namespaces.xsd" xmlns="http://www.smarteam.com/dev/ns/config/namespaces/1.0">
<configNamespace namespace="smarteam.std.webControls.config" filename="smarteam.std.webControls.config.xml" schemaFilename="webControls.xsd" /> <configNamespace namespace="smarteam.std.help.config" filename="smarteam.std.help.config.xml" schemaFilename="help.xsd" /> <configNamespace namespace="smarteam.std.nls.config" filename="smarteam.std.nls.config.xml" schemaFilename="nls.xsd" /> <configNamespace namespace="smarteam.std.progressIndicator.config" filename="smarteam.std.progressIndicator.config.xml" schemaFilename="progressIndicator.xsd" /> <configNamespace namespace="smarteam.std.redirect.config" filename="smarteam.std.redirect.config.xml" schemaFilename="redirect.xsd" /> <configNamespace namespace="smarteam.std.viewers.config" filename="smarteam.std.viewers.config.xml" schemaFilename="viewers.xsd" /> <configNamespace namespace="smarteam.std.preferences.config" filename="smarteam.std.preferences.config.xml" schemaFilename="preferences.xsd" /> <configNamespace namespace="smarteam.std.integration.config" filename="smarteam.std.integration.config.xml" schemaFilename="integration.xsd" /> <configNamespace namespace="smarteam.std.webEditor.config" filename="smarteam.std.webEditor.config.xml" schemaFilename="webEditor.xsd" /> <configNamespace namespace="smarteam.std.configClient.config" filename="smarteam.std.configClient.config.xml" schemaFilename="configClient.xsd" /> <configNamespace namespace="smarteam.std.favoriteSearches.config" filename="smarteam.std.favoriteSearches.config.xml" schemaFilename="favoriteSearches.xsd" /> <configNamespace namespace="smarteam.std.foundation.config" filename="smarteam.std.foundation.config.xml" schemaFilename="foundation.xsd" /> <configNamespace namespace="smarteam.std.nlsTranslationTool.config" filename="smarteam.std.nlsTranslationTool.config.xml" schemaFilename="nlsTranslationTool.xsd" /> <configNamespace namespace="smarteam.std.legacyPreferences.config" filename="smarteam.std.legacyPreferences.config.xml" schemaFilename="legacyPreferences.xsd" /> <configNamespace namespace="smarteam.std.lifeCycle.config" filename="smarteam.std.lifeCycle.config.xml" schemaFilename="lifeCycle.xsd" /> <configNamespace namespace="smarteam.std.authentication.config" filename="smarteam.std.authentication.config.xml" schemaFilename="authentication.xsd" /> <configNamespace namespace="smarteam.std.externalApplication.config" filename="smarteam.std.externalApplications.config.xml" schemaFilename="externalApplications.xsd" /> <configNamespace namespace="smarteam.std.embeddedScripts.config" filename="smarteam.std.embeddedScripts.config.xml" schemaFilename="embeddedScripts.xsd" /> <configNamespace namespace="smarteam.std.fileStorageManager.config" filename="smarteam.std.filestoragemanager.config.xml" schemaFilename="fileStorageManager.xsd" /> <configNamespace namespace="smarteam.std.clientLibraries.UI.config" filename="smarteam.std.clientLibraries.UI.config.xml" schemaFilename="clientLibrariesUI.xsd" /> <configNamespace namespace="smarteam.std.programManagement.config" filename="smarteam.std.programManagement.config.xml" schemaFilename="programManagement.xsd" /> <configNamespace namespace="smarteam.std.configurationManagement.config" filename="smarteam.std.configurationManagement.config.xml" schemaFilename="configurationManagement.xsd" /> <configNamespace namespace="smarteam.std.persistencyStorage.config" filename="smarteam.std.persistencyStorage.config.xml" schemaFilename="persistencyStorage.xsd" /> <configNamespace namespace="smarteam.std.workFlow.config" filename="smarteam.std.workFlow.config.xml" schemaFilename="workFlow.xsd" /> <configNamespace namespace="smarteam.std.dynamicTypeMappings.config" filename="smarteam.std.dynamicTypeMappings.config.xml" schemaFilename="dynamicTypeMappings.xsd" /> <configNamespace namespace="smarteam.std.messages.config" filename="smarteam.std.messages.config.xml" schemaFilename="messages.xsd" /> <configNamespace namespace="smarteam.std.clientLibraries.applications.config" filename="smarteam.std.clientLibraries.applications.config.xml" schemaFilename="clientLibrariesApplications.xsd" /> <configNamespace namespace="smarteam.std.sequence.config" filename="smarteam.std.sequence.config.xml" schemaFilename="sequence.xsd" /> <configNamespace namespace="smarteam.std.designCopy.config" filename="smarteam.std.designCopy.config.xml" schemaFilename="designCopy.xsd" /> <configNamespace namespace="smarteam.std.fileExplorer.config" filename="smarteam.std.fileExplorer.config.xml" schemaFilename="fileExplorer.xsd" /> <configNamespace namespace="smarteam.std.integration.proEngineer.config" filename="smarteam.std.integration.proEngineer.config.xml" schemaFilename="proEngineer.xsd" /> <configNamespace namespace="smarteam.std.relatedObjectsPane.config" filename="smarteam.std.relatedObjectsPane.config.xml" schemaFilename="relatedObjectsPane.xsd" /> <configNamespace namespace="smarteam.std.webEditor.viewsDisplaySettings.config" filename="smarteam.std.webEditor.viewsDisplaySettings.config.xml" schemaFilename="webEditorViewsDisplaySettings.xsd" /> <configNamespace namespace="smarteam.std.webEditor.navigationViews.config" filename="smarteam.std.webEditor.navigationViews.config.xml" schemaFilename="webEditorNavigationViews.xsd" /> <configNamespace namespace="smarteam.std.queries.config" filename="smarteam.std.queries.config.xml" schemaFilename="queries.xsd" /> </configNamespaces> |
| namespaces.xsd |
|
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema targetNamespace="http://www.smarteam.com/dev/ns/config/namespaces/1.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.smarteam.com/dev/ns/config/namespaces/1.0" elementFormDefault="qualified"> <xsd:element name="configNamespaces"> <xsd:complexType> <xsd:sequence> <xsd:element name="configNamespace" type="tns:configNamespaceType" maxOccurs="unbounded" /> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:complexType name="configNamespaceType"> <xsd:attribute name="namespace" type="xsd:string" use="required" /> <xsd:attribute name="filename" type="xsd:string" use="required" /> <xsd:attribute name="schemaFilename" type="xsd:string" use="required" /> </xsd:complexType> </xsd:schema> |
| 在DATA目录中有一个DEFAULT目录,namespaces.xml 文档中声明的XML文件都在这个DEFAULT目录中,namespaces.xml 文档中声明的XSD文件都在Schemas目录中,我只大概知道这是应用程序中使用的XML架构配置文件,这样的配置在实际程序中怎么加载并使用呢? |
| 我一直也想不清楚,请大家仁者见仁,发表一下意见。 |
| 这是我刚搜到的例子: http://www.cnblogs.com/chorrysky/archive/2006/12/06/584535.html (如何使用 XmlNamespaceManager 和 NameTable) http://chs.gotdotnet.com/quickstart/howto/doc/Xml/QueryXmlDocumentXPath.aspx (如何使用 XPath 表达式查询 XML) http://www.cnblogs.com/chorrysky/archive/2006/12/06/584526.html |
浙公网安备 33010602011771号