解析 XML 文档时出错
Error parsing an XML document
我正在通过 Oracle WebLogic Server 版本 12.1.2.0.0 MbeanMaker 实用程序(用于在 Oracle WebLogic Server 12.1.2.0.0 中创建自定义身份验证提供程序的实用程序)解析下一个文档。这是文档:
<?xml version="1.0" ?>
<!DOCTYPE MBeanType SYSTEM "commo.dtd">
<MbeanType Name = "DevicesAuthentication" DisplayName = "DevicesAuthentication"
Package = "fr.telecom.ws.security.iap"
Extends = "weblogic.management.security.authentication.Authenticator"
PersistPolicy = "OnUpdate">
<MbeanAttribute Name = "ProviderClassName" Type = "java.lang.String"
Writeable = "false"
Default =""fr.telecom.ws.security.iap.DevicesAuthenticationProviderImpl""
/>
<MbeanAttribute Name = "Description" Type = "java.lang.String"
Writeable = "false"
Default = ""Traces Authentication Provider""
/>
<MBeanAttribute Name = "Version" Type = "java.lang.String"
Writeable = "false" Default = ""1.0""
/>
</MBeanType>
这是文件 commo.dtd
<!--
This is the DTD for the definition of MBeans as defined by the
Common MBean Model (Commo).
Copyright (c) 2001-2002 by BEA Systems, Inc. All Rights Reserved.
-->
<!ELEMENT MBeanType (MBeanImport | MBeanAttribute | MBeanNotification | MBeanConstructor | MBeanOperation)*>
<!ATTLIST MBeanType
Abstract NMTOKEN #IMPLIED
Category NMTOKEN #IMPLIED
CachingDisabled NMTOKEN #IMPLIED
Classification NMTOKEN #IMPLIED
CurrencyTimeLimit NMTOKEN #IMPLIED
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
Export NMTOKEN #IMPLIED
Extends NMTOKEN #IMPLIED
GenerateExtendedAccessors NMTOKEN #IMPLIED
Implements CDATA #IMPLIED
InstanceExtent NMTOKEN #IMPLIED
LanguageMap NMTOKEN #IMPLIED
Listen NMTOKEN #IMPLIED
Locality NMTOKEN #IMPLIED
Log NMTOKEN #IMPLIED
LogFile CDATA #IMPLIED
MessageID NMTOKEN #IMPLIED
MBeanClassName CDATA #IMPLIED
Name NMTOKEN #REQUIRED
NoDoc NMTOKEN #IMPLIED
Package NMTOKEN #IMPLIED
PersistLocation CDATA #IMPLIED
PersistName CDATA #IMPLIED
PersistPeriod NMTOKEN #IMPLIED
PersistPolicy NMTOKEN #IMPLIED
PresentationString CDATA #IMPLIED
Readable NMTOKEN #IMPLIED
Servers CDATA #IMPLIED
VersionID NMTOKEN #IMPLIED
Visibility NMTOKEN #IMPLIED
Writeable NMTOKEN #IMPLIED>
<!ELEMENT MBeanImport (#PCDATA)>
<!ELEMENT MBeanAttribute EMPTY>
<!ATTLIST MBeanAttribute
AllowsSubTypes CDATA #IMPLIED
CachingDisabled NMTOKEN #IMPLIED
CurrencyTimeLimit NMTOKEN #IMPLIED
Default CDATA #IMPLIED
DefaultString CDATA #IMPLIED
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
Dynamic NMTOKEN #IMPLIED
Encrypted NMTOKEN #IMPLIED
Export CDATA #IMPLIED
GenerateExtendedAccessors NMTOKEN #IMPLIED
GetMethod NMTOKEN #IMPLIED
IsIs NMTOKEN #IMPLIED
Iterable NMTOKEN #IMPLIED
LanguageMap NMTOKEN #IMPLIED
LegalNull NMTOKEN #IMPLIED
LegalValues CDATA #IMPLIED
Listen NMTOKEN #IMPLIED
Log NMTOKEN #IMPLIED
LogFile CDATA #IMPLIED
Max NMTOKEN #IMPLIED
MessageID NMTOKEN #IMPLIED
Min NMTOKEN #IMPLIED
Name NMTOKEN #REQUIRED
NoDoc NMTOKEN #IMPLIED
NoDump NMTOKEN #IMPLIED
Obsolete CDATA #IMPLIED
PersistLocation CDATA #IMPLIED
PersistName CDATA #IMPLIED
PersistPeriod NMTOKEN #IMPLIED
PersistPolicy NMTOKEN #IMPLIED
PresentationString CDATA #IMPLIED
PreviouslyPersisted NMTOKEN #IMPLIED
ProtocolMap NMTOKEN #IMPLIED
Readable NMTOKEN #IMPLIED
InterfaceType CDATA #IMPLIED
SetMethod NMTOKEN #IMPLIED
Type CDATA #IMPLIED
Validator NMTOKEN #IMPLIED
Visibility NMTOKEN #IMPLIED
Writeable NMTOKEN #IMPLIED>
<!ELEMENT MBeanNotification EMPTY>
<!ATTLIST MBeanNotification
ClassName NMTOKEN #IMPLIED
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
LanguageMap NMTOKEN #IMPLIED
Listen NMTOKEN #IMPLIED
Log NMTOKEN #IMPLIED
LogFile CDATA #IMPLIED
MessageID NMTOKEN #IMPLIED
NoDoc NMTOKEN #IMPLIED
NotificationTypes CDATA #REQUIRED
PresentationString CDATA #IMPLIED
Severity NMTOKEN #IMPLIED
Visibility NMTOKEN #IMPLIED>
<!ELEMENT MBeanConstructor (MBeanException | MBeanOperationArg)*>
<!ATTLIST MBeanConstructor
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
LanguageMap NMTOKEN #IMPLIED
Listen NMTOKEN #IMPLIED
MessageID NMTOKEN #IMPLIED
Name NMTOKEN #IMPLIED
NoDoc NMTOKEN #IMPLIED
PresentationString CDATA #IMPLIED
Visibility NMTOKEN #IMPLIED>
<!ELEMENT MBeanOperation (MBeanException | MBeanOperationArg)*>
<!ATTLIST MBeanOperation
CurrencyTimeLimit NMTOKEN #IMPLIED
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
GenerateImplementation CDATA #IMPLIED
Impact NMTOKEN #IMPLIED
LanguageMap NMTOKEN #IMPLIED
Listen NMTOKEN #IMPLIED
MessageID NMTOKEN #IMPLIED
Name NMTOKEN #REQUIRED
NoDoc NMTOKEN #IMPLIED
PresentationString CDATA #IMPLIED
ReturnType CDATA #IMPLIED
ReturnTypeDescription CDATA #IMPLIED
Visibility NMTOKEN #IMPLIED>
<!ELEMENT MBeanException (#PCDATA)>
<!ELEMENT MBeanOperationArg EMPTY>
<!ATTLIST MBeanOperationArg
Name NMTOKEN #REQUIRED
Type CDATA "java.lang.String"
InterfaceType CDATA #IMPLIED
Description CDATA #IMPLIED>
但是当我执行解析 XML 文件的实用程序时出现了这个奇怪的错误:
MyAuthentication.xml; lineNumber: 22; columnNumber: 3; The element type "MbeanType" must be terminated by the matching end-tag "</MbeanType>".
但文件仅以第 22 行的标记结尾
关闭标签和打开标签之间的 mBeanType 标签大小写不匹配。一个说 MbeanType
另一个说 MBeanType
根据dtd,开始标签应该是MBeanType
。
我正在通过 Oracle WebLogic Server 版本 12.1.2.0.0 MbeanMaker 实用程序(用于在 Oracle WebLogic Server 12.1.2.0.0 中创建自定义身份验证提供程序的实用程序)解析下一个文档。这是文档:
<?xml version="1.0" ?>
<!DOCTYPE MBeanType SYSTEM "commo.dtd">
<MbeanType Name = "DevicesAuthentication" DisplayName = "DevicesAuthentication"
Package = "fr.telecom.ws.security.iap"
Extends = "weblogic.management.security.authentication.Authenticator"
PersistPolicy = "OnUpdate">
<MbeanAttribute Name = "ProviderClassName" Type = "java.lang.String"
Writeable = "false"
Default =""fr.telecom.ws.security.iap.DevicesAuthenticationProviderImpl""
/>
<MbeanAttribute Name = "Description" Type = "java.lang.String"
Writeable = "false"
Default = ""Traces Authentication Provider""
/>
<MBeanAttribute Name = "Version" Type = "java.lang.String"
Writeable = "false" Default = ""1.0""
/>
</MBeanType>
这是文件 commo.dtd
<!--
This is the DTD for the definition of MBeans as defined by the
Common MBean Model (Commo).
Copyright (c) 2001-2002 by BEA Systems, Inc. All Rights Reserved.
-->
<!ELEMENT MBeanType (MBeanImport | MBeanAttribute | MBeanNotification | MBeanConstructor | MBeanOperation)*>
<!ATTLIST MBeanType
Abstract NMTOKEN #IMPLIED
Category NMTOKEN #IMPLIED
CachingDisabled NMTOKEN #IMPLIED
Classification NMTOKEN #IMPLIED
CurrencyTimeLimit NMTOKEN #IMPLIED
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
Export NMTOKEN #IMPLIED
Extends NMTOKEN #IMPLIED
GenerateExtendedAccessors NMTOKEN #IMPLIED
Implements CDATA #IMPLIED
InstanceExtent NMTOKEN #IMPLIED
LanguageMap NMTOKEN #IMPLIED
Listen NMTOKEN #IMPLIED
Locality NMTOKEN #IMPLIED
Log NMTOKEN #IMPLIED
LogFile CDATA #IMPLIED
MessageID NMTOKEN #IMPLIED
MBeanClassName CDATA #IMPLIED
Name NMTOKEN #REQUIRED
NoDoc NMTOKEN #IMPLIED
Package NMTOKEN #IMPLIED
PersistLocation CDATA #IMPLIED
PersistName CDATA #IMPLIED
PersistPeriod NMTOKEN #IMPLIED
PersistPolicy NMTOKEN #IMPLIED
PresentationString CDATA #IMPLIED
Readable NMTOKEN #IMPLIED
Servers CDATA #IMPLIED
VersionID NMTOKEN #IMPLIED
Visibility NMTOKEN #IMPLIED
Writeable NMTOKEN #IMPLIED>
<!ELEMENT MBeanImport (#PCDATA)>
<!ELEMENT MBeanAttribute EMPTY>
<!ATTLIST MBeanAttribute
AllowsSubTypes CDATA #IMPLIED
CachingDisabled NMTOKEN #IMPLIED
CurrencyTimeLimit NMTOKEN #IMPLIED
Default CDATA #IMPLIED
DefaultString CDATA #IMPLIED
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
Dynamic NMTOKEN #IMPLIED
Encrypted NMTOKEN #IMPLIED
Export CDATA #IMPLIED
GenerateExtendedAccessors NMTOKEN #IMPLIED
GetMethod NMTOKEN #IMPLIED
IsIs NMTOKEN #IMPLIED
Iterable NMTOKEN #IMPLIED
LanguageMap NMTOKEN #IMPLIED
LegalNull NMTOKEN #IMPLIED
LegalValues CDATA #IMPLIED
Listen NMTOKEN #IMPLIED
Log NMTOKEN #IMPLIED
LogFile CDATA #IMPLIED
Max NMTOKEN #IMPLIED
MessageID NMTOKEN #IMPLIED
Min NMTOKEN #IMPLIED
Name NMTOKEN #REQUIRED
NoDoc NMTOKEN #IMPLIED
NoDump NMTOKEN #IMPLIED
Obsolete CDATA #IMPLIED
PersistLocation CDATA #IMPLIED
PersistName CDATA #IMPLIED
PersistPeriod NMTOKEN #IMPLIED
PersistPolicy NMTOKEN #IMPLIED
PresentationString CDATA #IMPLIED
PreviouslyPersisted NMTOKEN #IMPLIED
ProtocolMap NMTOKEN #IMPLIED
Readable NMTOKEN #IMPLIED
InterfaceType CDATA #IMPLIED
SetMethod NMTOKEN #IMPLIED
Type CDATA #IMPLIED
Validator NMTOKEN #IMPLIED
Visibility NMTOKEN #IMPLIED
Writeable NMTOKEN #IMPLIED>
<!ELEMENT MBeanNotification EMPTY>
<!ATTLIST MBeanNotification
ClassName NMTOKEN #IMPLIED
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
LanguageMap NMTOKEN #IMPLIED
Listen NMTOKEN #IMPLIED
Log NMTOKEN #IMPLIED
LogFile CDATA #IMPLIED
MessageID NMTOKEN #IMPLIED
NoDoc NMTOKEN #IMPLIED
NotificationTypes CDATA #REQUIRED
PresentationString CDATA #IMPLIED
Severity NMTOKEN #IMPLIED
Visibility NMTOKEN #IMPLIED>
<!ELEMENT MBeanConstructor (MBeanException | MBeanOperationArg)*>
<!ATTLIST MBeanConstructor
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
LanguageMap NMTOKEN #IMPLIED
Listen NMTOKEN #IMPLIED
MessageID NMTOKEN #IMPLIED
Name NMTOKEN #IMPLIED
NoDoc NMTOKEN #IMPLIED
PresentationString CDATA #IMPLIED
Visibility NMTOKEN #IMPLIED>
<!ELEMENT MBeanOperation (MBeanException | MBeanOperationArg)*>
<!ATTLIST MBeanOperation
CurrencyTimeLimit NMTOKEN #IMPLIED
Deprecated NMTOKEN #IMPLIED
Description CDATA #IMPLIED
DisplayMessage CDATA #IMPLIED
DisplayName CDATA #IMPLIED
GenerateImplementation CDATA #IMPLIED
Impact NMTOKEN #IMPLIED
LanguageMap NMTOKEN #IMPLIED
Listen NMTOKEN #IMPLIED
MessageID NMTOKEN #IMPLIED
Name NMTOKEN #REQUIRED
NoDoc NMTOKEN #IMPLIED
PresentationString CDATA #IMPLIED
ReturnType CDATA #IMPLIED
ReturnTypeDescription CDATA #IMPLIED
Visibility NMTOKEN #IMPLIED>
<!ELEMENT MBeanException (#PCDATA)>
<!ELEMENT MBeanOperationArg EMPTY>
<!ATTLIST MBeanOperationArg
Name NMTOKEN #REQUIRED
Type CDATA "java.lang.String"
InterfaceType CDATA #IMPLIED
Description CDATA #IMPLIED>
但是当我执行解析 XML 文件的实用程序时出现了这个奇怪的错误:
MyAuthentication.xml; lineNumber: 22; columnNumber: 3; The element type "MbeanType" must be terminated by the matching end-tag "</MbeanType>".
但文件仅以第 22 行的标记结尾
关闭标签和打开标签之间的 mBeanType 标签大小写不匹配。一个说 MbeanType
另一个说 MBeanType
根据dtd,开始标签应该是MBeanType
。