System.Xml.XmlException:该元素不能包含空格。内容模型为空

发布于 2024-10-21 02:52:42 字数 17400 浏览 2 评论 0原文

我正在使用 Dtd 来验证从用户那里收到的 xml 字符串,但我不断收到此异常:

System.Xml.XmlException: The element cannot contain white space. 
Content model is empty. ---> System.Xml.XmlException: 
The element cannot contain white space. Content model is empty.
---> System.Xml.Schema.XmlSchemaException: 
The element cannot contain white space. Content model is empty.

如何从 XML 字符串中删除那些无效的空白字符?

过去3个小时我一直在为此苦苦挣扎。

这是我编写的用于进行 DTD 验证的方法:

public static void Validate(string xmlToValidate, string documentType, string dtd)
    {
        try
        {
            Check.Argument.IsNotNullOrEmpty(documentType, "documentType");
            Check.Argument.IsNotNullOrEmpty(xmlToValidate, "xmlToValidate");
            Check.Argument.IsNotNullOrEmpty(dtd, "dtd");


            //clean the xml
            string xml = SanitizeXml(xmlToValidate);

            XmlDocument xmlDoc = new XmlDocument();

            //append the dtd to the xml doc
            XmlDocumentType docType = xmlDoc.CreateDocumentType(documentType, null,      null, dtd);
            xmlDoc.AppendChild(docType);

            var xmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", null, null);

            xmlDoc.InsertBefore(xmlDeclaration, docType);

            xml = RemoveDeclaration(xml);

            //Append XML to the Xml Doc
            xmlDoc.AppendXml(xml);

            XmlReaderSettings settings = new XmlReaderSettings();
            settings.DtdProcessing = DtdProcessing.Parse;
            settings.ValidationType = ValidationType.DTD;

            settings.ValidationEventHandler += (sender, e) =>
            {
                throw new XmlException(e.Message, e.Exception);
            };

            StringWriter stringWriter = new StringWriter();

            //save the xmlDoc content to the writer
            xmlDoc.Save(stringWriter);

            XmlReader rdr = XmlReader.Create(new StringReader(stringWriter.ToString    ()), settings);

            //Parse the xml to check DTD conformance
            while (rdr.Read()) ;

            //Close
            rdr.Close();
        }
        catch (Exception ex)
        {
            XmlException e = new XmlException(ex.Message, ex);
            throw e;
        }

    }Here's the string I'm testing with (but I'll be receiving it from external source) :

public const string XmlEMSOrder = @"<?xml version='1.0' encoding='utf-8' ?>
<Root>
  <OrderInformation>
    <Project>
      <ProjName>Project name </ProjName>
      <ContactName>Proj Contact </ContactName>
      <Phone>Proj Phone</Phone>
      <PONo>Project End User PO</PONo>
      <ProjectNo>Project# </ProjectNo>
      <RSPNo>Quote Trent</RSPNo>
      <SalesmanName>SalesFN1 SalesLN1</SalesmanName>
      <Salesman2Name>SalesFN2 SalesLN2</Salesman2Name>
      <Salesman3Name />
      <ACPONo>AC PO Number</ACPONo>
      <NationalAccountAgreement>1</NationalAccountAgreement>
      <Agreement />
      <AccountType />
      <HealthCare />
      <Government />
      <Other />
      <GovAccount>1</GovAccount>
       ....

这是我使用的 Dtd:

             public const string Dtd = @"<!ELEMENT ACDiscount ( #PCDATA ) >

                                <!ELEMENT ACPONo ( #PCDATA ) >

                                <!ELEMENT AccountType EMPTY >

                                <!ELEMENT AddExistingSystem ( #PCDATA ) >

                                <!ELEMENT AddOn EMPTY >

                                <!ELEMENT Address1 ( #PCDATA ) >

                                <!ELEMENT Address2 ( #PCDATA ) >

                                <!ELEMENT Address3 ( #PCDATA ) >

                                <!ELEMENT AddressCity ( #PCDATA ) >

                                <!ELEMENT AddressCountry ( #PCDATA ) >

                                <!ELEMENT AddressCounty ( #PCDATA ) >

                                <!ELEMENT AddressState EMPTY >

                                <!ELEMENT AddressZIP ( #PCDATA ) >

                                <!ELEMENT Agreement EMPTY >

                                <!ELEMENT AmericanDisability ( #PCDATA ) >

                                <!ELEMENT Article ( BlanketRelease | Color | Description | ExtraInfo | PartNo | Price | Qty | SCOLOR | ShipPromiseDate | ShipRequestDate | UOM | UnitPrice | characteristics )* >

                                <!ELEMENT AttachGridDrawing ( #PCDATA ) >

                                <!ELEMENT BackToBack ( #PCDATA ) >

                                <!ELEMENT BaseLocation ( #PCDATA ) >

                                <!ELEMENT BaseName ( #PCDATA ) >

                                <!ELEMENT BaseType EMPTY >

                                <!ELEMENT BidDueDate EMPTY >

                                <!ELEMENT BlanketOrRegular ( #PCDATA ) >

                                <!ELEMENT BlanketRelease ( #PCDATA | ReleaseNumber | Status )* >

                                <!ELEMENT BoM ( #PCDATA | Position )* >

                                <!ELEMENT Books ( #PCDATA ) >

                                <!ELEMENT Boxes ( #PCDATA ) >

                                <!ELEMENT Cabinets ( #PCDATA ) >

                                <!ELEMENT Cantilever ( #PCDATA ) >

                                <!ELEMENT CarpetChoice ( #PCDATA ) >

                                <!ELEMENT Carrier ( #PCDATA ) >

                                <!ELEMENT CarrierCode ( #PCDATA ) >

                                <!ELEMENT CarrierInstructions ( #PCDATA ) >

                                <!ELEMENT ClearHeight ( #PCDATA ) >

                                <!ELEMENT CollectPrepaid ( #PCDATA ) >

                                <!ELEMENT Color ( #PCDATA ) >

                                <!ELEMENT Comments ( #PCDATA ) >

                                <!ELEMENT CompanyAddress1 ( #PCDATA ) >

                                <!ELEMENT CompanyAddress2 ( #PCDATA ) >

                                <!ELEMENT CompanyCity ( #PCDATA ) >

                                <!ELEMENT CompanyContact ( #PCDATA ) >

                                <!ELEMENT CompanyDepartment ( #PCDATA ) >

                                <!ELEMENT CompanyName ( #PCDATA ) >

                                <!ELEMENT CompanyPhone ( #PCDATA ) >

                                <!ELEMENT CompanyZIP ( #PCDATA ) >

                                <!ELEMENT ComponentLength ( #PCDATA ) >

                                <!ELEMENT ComputerFloor ( #PCDATA ) >

                                <!ELEMENT ConfiguraRoot ( #PCDATA | BoM | OrderInformation )* >

                                <!ELEMENT ConfirmedSettings ( #PCDATA ) >

                                <!ELEMENT Contact ( #PCDATA ) >

                                <!ELEMENT ContactName ( #PCDATA ) >

                                <!ELEMENT ContractName ( #PCDATA ) >

                                <!ELEMENT ContractNumber ( #PCDATA ) >

                                <!ELEMENT ContractSSC ( #PCDATA ) >

                                <!ELEMENT ContractType ( #PCDATA ) >

                                <!ELEMENT CustomerCompany ( CompanyContact, CompanyName, CompanyAddress1, CompanyAddress2, CompanyCity, CompanyZIP, CompanyDepartment, CompanyPhone ) >

                                <!ELEMENT CustomerNumber ( #PCDATA ) >

                                <!ELEMENT Delivery ( ShipRequestDate, RailFloorDate, Contact, Phone, Address1, Address2, Address3, AddressCity, AddressState, AddressZIP, ShipToContact, ShipToPhone, ShipToAddress1, ShipToAddress2, ShipToAddress3, ShipToAddressCity, ShipToAddressState, ShipToAddressZIP, Carrier, CarrierInstructions, RequireSupervision ) >

                                <!ELEMENT Department ( #PCDATA ) >

                                <!ELEMENT Description ( #PCDATA ) >

                                <!ELEMENT DrawnBy ( #PCDATA ) >

                                <!ELEMENT EndUserDiscount ( #PCDATA ) >

                                <!ELEMENT ExtraInfo ( #PCDATA ) >

                                <!ELEMENT ExtranetLeadOrProj ( #PCDATA ) >

                                <!ELEMENT Files ( #PCDATA ) >

                                <!ELEMENT FloorMaterial ( #PCDATA ) >

                                <!ELEMENT ForceOrder ( #PCDATA ) >

                                <!ELEMENT GSA ( #PCDATA ) >

                                <!ELEMENT GovAccount ( #PCDATA ) >

                                <!ELEMENT Government EMPTY >

                                <!ELEMENT Group ( #PCDATA | ACDiscount | Article | Description | EndUserDiscount )* >

                                <!ELEMENT HasContractAgreement ( #PCDATA ) >

                                <!ELEMENT HealthCare EMPTY >

                                <!ELEMENT HeightDepthRatio EMPTY >

                                <!ELEMENT Historical ( #PCDATA ) >

                                <!ELEMENT IndustrialClip ( #PCDATA ) >

                                <!ELEMENT IndustrialRacks ( #PCDATA ) >

                                <!ELEMENT Installation ( MarketFocus, MarketFocusOther, Contact, Address1, Address2, Address3, AddressCity, AddressState, AddressZIP, AddressCounty, AddressCountry, Department, Phone, Files, Boxes, Books, Media, Other, OtherItems, materialStored, Historical, Relocation, PlanningComments ) >

                                <!ELEMENT IsMilitaryBase ( #PCDATA ) >

                                <!ELEMENT LeadOrProj ( #PCDATA ) >

                                <!ELEMENT Location ( #PCDATA ) >

                                <!ELEMENT LvlGov ( #PCDATA ) >

                                <!ELEMENT ManufactureOrStorage ( #PCDATA ) >

                                <!ELEMENT MarketFocus EMPTY >

                                <!ELEMENT MarketFocusOther EMPTY >

                                <!ELEMENT Media ( #PCDATA ) >

                                <!ELEMENT NationalAccountAgreement ( #PCDATA ) >

                                <!ELEMENT NationalAccountNo EMPTY >

                                <!ELEMENT NationalAccountSubID EMPTY >

                                <!ELEMENT NewConstruction ( #PCDATA ) >

                                <!ELEMENT NoOfShelves EMPTY >

                                <!ELEMENT NonSSCShelving ( Cantilever, Cabinets, PostCase, StackBoxFiles, WideSpan, Other, IndustrialClip, VerifiedDimensions, BackToBack, IndustrialRacks, OtherStr, PostType, VerifiedDimensionsStr, OverallDepth, OverallLength, OverallHeight, NoOfShelves ) >

                                <!ELEMENT OrderInfoRoom ( NewConstruction, AmericanDisability, ComputerFloor, AttachGridDrawing, RecessedOptions, ComponentLength, FloorMaterial, CarpetChoice, HeightDepthRatio, ClearHeight, Comments ) >

                                <!ELEMENT OrderInformation ( #PCDATA | BlanketRelease | Delivery | Installation | NonSSCShelving | OrderInfoRoom | Project )* >

                                <!ELEMENT OrderNumber ( #PCDATA ) >

                                <!ELEMENT OrderType ( #PCDATA ) >

                                <!ELEMENT OrderTypeProject ( #PCDATA ) >

                                <!ELEMENT Other ( #PCDATA ) >

                                <!ELEMENT OtherItems EMPTY >

                                <!ELEMENT OtherStr EMPTY >

                                <!ELEMENT OverallDepth EMPTY >

                                <!ELEMENT OverallHeight EMPTY >

                                <!ELEMENT OverallLength EMPTY >

                                <!ELEMENT PONo ( #PCDATA ) >

                                <!ELEMENT PartNo ( #PCDATA ) >

                                <!ELEMENT Phone ( #PCDATA ) >

                                <!ELEMENT PlanningComments EMPTY >

                                <!ELEMENT Position ( #PCDATA | Description | Group )* >

                                <!ELEMENT PostCase ( #PCDATA ) >

                                <!ELEMENT PostType EMPTY >

                                <!ELEMENT Price ( #PCDATA ) >

                                <!ELEMENT ProjAddProjName ( #PCDATA ) >

                                <!ELEMENT ProjAddSSCOrderNo ( #PCDATA ) >

                                <!ELEMENT ProjName ( #PCDATA ) >

                                <!ELEMENT Project ( ProjName, ContactName, Phone, PONo, ProjectNo, RSPNo, SalesmanName, Salesman2Name, Salesman3Name, ACPONo, NationalAccountAgreement, Agreement, AccountType, HealthCare, Government, Other, GovAccount, LvlGov, GSA, HasContractAgreement, ContractType, ContractName, ContractSSC, ContractNumber, IsMilitaryBase, BaseLocation, BaseName, BaseType, ManufactureOrStorage, QS, SpecialQuote, UseOldPricing, ExtranetLeadOrProj, LeadOrProj, AddExistingSystem, ProjAddSSCOrderNo, ProjAddProjName, DrawnBy, SICCode, Comments, BidDueDate, ConfirmedSettings, CustomerCompany, NationalAccountNo, NationalAccountSubID, SalesRep1, SalesRep2, SalesRep3, System, SystemType, SIC, Location, CollectPrepaid, RefersTo, AddOn, OrderType, OrderTypeProject, BlanketOrRegular, CarrierCode, SourceEmail, CustomerNumber, ShipRequestDate, RFShipRequestDate, OrderNumber, Status, ForceOrder ) >

                                <!ELEMENT ProjectNo ( #PCDATA ) >

                                <!ELEMENT QS ( #PCDATA ) >

                                <!ELEMENT Qty ( #PCDATA ) >

                                <!ELEMENT RFShipRequestDate ( #PCDATA ) >

                                <!ELEMENT RSPNo ( #PCDATA ) >

                                <!ELEMENT RailFloorDate ( #PCDATA ) >

                                <!ELEMENT RecessedOptions ( #PCDATA ) >

                                <!ELEMENT RefersTo EMPTY >

                                <!ELEMENT ReleaseNumber ( #PCDATA ) >

                                <!ELEMENT Relocation ( #PCDATA ) >

                                <!ELEMENT RequireSupervision ( #PCDATA ) >

                                <!ELEMENT SCOLOR ( #PCDATA ) >

                                <!ELEMENT SIC ( #PCDATA ) >

                                <!ELEMENT SICCode ( #PCDATA ) >

                                <!ELEMENT SalesRep1 ( #PCDATA ) >

                                <!ELEMENT SalesRep2 ( #PCDATA ) >

                                <!ELEMENT SalesRep3 ( #PCDATA ) >

                                <!ELEMENT Salesman2Name ( #PCDATA ) >

                                <!ELEMENT Salesman3Name EMPTY >

                                <!ELEMENT SalesmanName ( #PCDATA ) >

                                <!ELEMENT ShipPromiseDate ( #PCDATA ) >

                                <!ELEMENT ShipRequestDate ( #PCDATA ) >

                                <!ELEMENT ShipToAddress1 ( #PCDATA ) >

                                <!ELEMENT ShipToAddress2 ( #PCDATA ) >

                                <!ELEMENT ShipToAddress3 ( #PCDATA ) >

                                <!ELEMENT ShipToAddressCity ( #PCDATA ) >

                                <!ELEMENT ShipToAddressState EMPTY >

                                <!ELEMENT ShipToAddressZIP ( #PCDATA ) >

                                <!ELEMENT ShipToContact ( #PCDATA ) >

                                <!ELEMENT ShipToPhone ( #PCDATA ) >

                                <!ELEMENT SourceEmail EMPTY >

                                <!ELEMENT SpecialQuote ( #PCDATA ) >

                                <!ELEMENT StackBoxFiles ( #PCDATA ) >

                                <!ELEMENT Status ( #PCDATA ) >

                                <!ELEMENT System ( #PCDATA ) >

                                <!ELEMENT SystemType EMPTY >

                                <!ELEMENT UOM ( #PCDATA ) >

                                <!ELEMENT UnitPrice ( #PCDATA ) >

                                <!ELEMENT UseOldPricing ( #PCDATA ) >

                                <!ELEMENT VerifiedDimensions ( #PCDATA ) >

                                <!ELEMENT VerifiedDimensionsStr EMPTY >

                                <!ELEMENT WideSpan ( #PCDATA ) >

                                <!ELEMENT characteristics EMPTY >

                                <!ELEMENT materialStored ( #PCDATA ) >";

I am using Dtd to validate an xml string I receive from users, and I keep getting this exception :

System.Xml.XmlException: The element cannot contain white space. 
Content model is empty. ---> System.Xml.XmlException: 
The element cannot contain white space. Content model is empty.
---> System.Xml.Schema.XmlSchemaException: 
The element cannot contain white space. Content model is empty.

How to remove those invalid white space characters from an XML string ?

I've been struggling with this for the past 3 hours.

Here's the method I wrote to do DTD validation :

public static void Validate(string xmlToValidate, string documentType, string dtd)
    {
        try
        {
            Check.Argument.IsNotNullOrEmpty(documentType, "documentType");
            Check.Argument.IsNotNullOrEmpty(xmlToValidate, "xmlToValidate");
            Check.Argument.IsNotNullOrEmpty(dtd, "dtd");


            //clean the xml
            string xml = SanitizeXml(xmlToValidate);

            XmlDocument xmlDoc = new XmlDocument();

            //append the dtd to the xml doc
            XmlDocumentType docType = xmlDoc.CreateDocumentType(documentType, null,      null, dtd);
            xmlDoc.AppendChild(docType);

            var xmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", null, null);

            xmlDoc.InsertBefore(xmlDeclaration, docType);

            xml = RemoveDeclaration(xml);

            //Append XML to the Xml Doc
            xmlDoc.AppendXml(xml);

            XmlReaderSettings settings = new XmlReaderSettings();
            settings.DtdProcessing = DtdProcessing.Parse;
            settings.ValidationType = ValidationType.DTD;

            settings.ValidationEventHandler += (sender, e) =>
            {
                throw new XmlException(e.Message, e.Exception);
            };

            StringWriter stringWriter = new StringWriter();

            //save the xmlDoc content to the writer
            xmlDoc.Save(stringWriter);

            XmlReader rdr = XmlReader.Create(new StringReader(stringWriter.ToString    ()), settings);

            //Parse the xml to check DTD conformance
            while (rdr.Read()) ;

            //Close
            rdr.Close();
        }
        catch (Exception ex)
        {
            XmlException e = new XmlException(ex.Message, ex);
            throw e;
        }

    }Here's the string I'm testing with (but I'll be receiving it from external source) :

public const string XmlEMSOrder = @"<?xml version='1.0' encoding='utf-8' ?>
<Root>
  <OrderInformation>
    <Project>
      <ProjName>Project name </ProjName>
      <ContactName>Proj Contact </ContactName>
      <Phone>Proj Phone</Phone>
      <PONo>Project End User PO</PONo>
      <ProjectNo>Project# </ProjectNo>
      <RSPNo>Quote Trent</RSPNo>
      <SalesmanName>SalesFN1 SalesLN1</SalesmanName>
      <Salesman2Name>SalesFN2 SalesLN2</Salesman2Name>
      <Salesman3Name />
      <ACPONo>AC PO Number</ACPONo>
      <NationalAccountAgreement>1</NationalAccountAgreement>
      <Agreement />
      <AccountType />
      <HealthCare />
      <Government />
      <Other />
      <GovAccount>1</GovAccount>
       ....

Here is the Dtd I use :

             public const string Dtd = @"<!ELEMENT ACDiscount ( #PCDATA ) >

                                <!ELEMENT ACPONo ( #PCDATA ) >

                                <!ELEMENT AccountType EMPTY >

                                <!ELEMENT AddExistingSystem ( #PCDATA ) >

                                <!ELEMENT AddOn EMPTY >

                                <!ELEMENT Address1 ( #PCDATA ) >

                                <!ELEMENT Address2 ( #PCDATA ) >

                                <!ELEMENT Address3 ( #PCDATA ) >

                                <!ELEMENT AddressCity ( #PCDATA ) >

                                <!ELEMENT AddressCountry ( #PCDATA ) >

                                <!ELEMENT AddressCounty ( #PCDATA ) >

                                <!ELEMENT AddressState EMPTY >

                                <!ELEMENT AddressZIP ( #PCDATA ) >

                                <!ELEMENT Agreement EMPTY >

                                <!ELEMENT AmericanDisability ( #PCDATA ) >

                                <!ELEMENT Article ( BlanketRelease | Color | Description | ExtraInfo | PartNo | Price | Qty | SCOLOR | ShipPromiseDate | ShipRequestDate | UOM | UnitPrice | characteristics )* >

                                <!ELEMENT AttachGridDrawing ( #PCDATA ) >

                                <!ELEMENT BackToBack ( #PCDATA ) >

                                <!ELEMENT BaseLocation ( #PCDATA ) >

                                <!ELEMENT BaseName ( #PCDATA ) >

                                <!ELEMENT BaseType EMPTY >

                                <!ELEMENT BidDueDate EMPTY >

                                <!ELEMENT BlanketOrRegular ( #PCDATA ) >

                                <!ELEMENT BlanketRelease ( #PCDATA | ReleaseNumber | Status )* >

                                <!ELEMENT BoM ( #PCDATA | Position )* >

                                <!ELEMENT Books ( #PCDATA ) >

                                <!ELEMENT Boxes ( #PCDATA ) >

                                <!ELEMENT Cabinets ( #PCDATA ) >

                                <!ELEMENT Cantilever ( #PCDATA ) >

                                <!ELEMENT CarpetChoice ( #PCDATA ) >

                                <!ELEMENT Carrier ( #PCDATA ) >

                                <!ELEMENT CarrierCode ( #PCDATA ) >

                                <!ELEMENT CarrierInstructions ( #PCDATA ) >

                                <!ELEMENT ClearHeight ( #PCDATA ) >

                                <!ELEMENT CollectPrepaid ( #PCDATA ) >

                                <!ELEMENT Color ( #PCDATA ) >

                                <!ELEMENT Comments ( #PCDATA ) >

                                <!ELEMENT CompanyAddress1 ( #PCDATA ) >

                                <!ELEMENT CompanyAddress2 ( #PCDATA ) >

                                <!ELEMENT CompanyCity ( #PCDATA ) >

                                <!ELEMENT CompanyContact ( #PCDATA ) >

                                <!ELEMENT CompanyDepartment ( #PCDATA ) >

                                <!ELEMENT CompanyName ( #PCDATA ) >

                                <!ELEMENT CompanyPhone ( #PCDATA ) >

                                <!ELEMENT CompanyZIP ( #PCDATA ) >

                                <!ELEMENT ComponentLength ( #PCDATA ) >

                                <!ELEMENT ComputerFloor ( #PCDATA ) >

                                <!ELEMENT ConfiguraRoot ( #PCDATA | BoM | OrderInformation )* >

                                <!ELEMENT ConfirmedSettings ( #PCDATA ) >

                                <!ELEMENT Contact ( #PCDATA ) >

                                <!ELEMENT ContactName ( #PCDATA ) >

                                <!ELEMENT ContractName ( #PCDATA ) >

                                <!ELEMENT ContractNumber ( #PCDATA ) >

                                <!ELEMENT ContractSSC ( #PCDATA ) >

                                <!ELEMENT ContractType ( #PCDATA ) >

                                <!ELEMENT CustomerCompany ( CompanyContact, CompanyName, CompanyAddress1, CompanyAddress2, CompanyCity, CompanyZIP, CompanyDepartment, CompanyPhone ) >

                                <!ELEMENT CustomerNumber ( #PCDATA ) >

                                <!ELEMENT Delivery ( ShipRequestDate, RailFloorDate, Contact, Phone, Address1, Address2, Address3, AddressCity, AddressState, AddressZIP, ShipToContact, ShipToPhone, ShipToAddress1, ShipToAddress2, ShipToAddress3, ShipToAddressCity, ShipToAddressState, ShipToAddressZIP, Carrier, CarrierInstructions, RequireSupervision ) >

                                <!ELEMENT Department ( #PCDATA ) >

                                <!ELEMENT Description ( #PCDATA ) >

                                <!ELEMENT DrawnBy ( #PCDATA ) >

                                <!ELEMENT EndUserDiscount ( #PCDATA ) >

                                <!ELEMENT ExtraInfo ( #PCDATA ) >

                                <!ELEMENT ExtranetLeadOrProj ( #PCDATA ) >

                                <!ELEMENT Files ( #PCDATA ) >

                                <!ELEMENT FloorMaterial ( #PCDATA ) >

                                <!ELEMENT ForceOrder ( #PCDATA ) >

                                <!ELEMENT GSA ( #PCDATA ) >

                                <!ELEMENT GovAccount ( #PCDATA ) >

                                <!ELEMENT Government EMPTY >

                                <!ELEMENT Group ( #PCDATA | ACDiscount | Article | Description | EndUserDiscount )* >

                                <!ELEMENT HasContractAgreement ( #PCDATA ) >

                                <!ELEMENT HealthCare EMPTY >

                                <!ELEMENT HeightDepthRatio EMPTY >

                                <!ELEMENT Historical ( #PCDATA ) >

                                <!ELEMENT IndustrialClip ( #PCDATA ) >

                                <!ELEMENT IndustrialRacks ( #PCDATA ) >

                                <!ELEMENT Installation ( MarketFocus, MarketFocusOther, Contact, Address1, Address2, Address3, AddressCity, AddressState, AddressZIP, AddressCounty, AddressCountry, Department, Phone, Files, Boxes, Books, Media, Other, OtherItems, materialStored, Historical, Relocation, PlanningComments ) >

                                <!ELEMENT IsMilitaryBase ( #PCDATA ) >

                                <!ELEMENT LeadOrProj ( #PCDATA ) >

                                <!ELEMENT Location ( #PCDATA ) >

                                <!ELEMENT LvlGov ( #PCDATA ) >

                                <!ELEMENT ManufactureOrStorage ( #PCDATA ) >

                                <!ELEMENT MarketFocus EMPTY >

                                <!ELEMENT MarketFocusOther EMPTY >

                                <!ELEMENT Media ( #PCDATA ) >

                                <!ELEMENT NationalAccountAgreement ( #PCDATA ) >

                                <!ELEMENT NationalAccountNo EMPTY >

                                <!ELEMENT NationalAccountSubID EMPTY >

                                <!ELEMENT NewConstruction ( #PCDATA ) >

                                <!ELEMENT NoOfShelves EMPTY >

                                <!ELEMENT NonSSCShelving ( Cantilever, Cabinets, PostCase, StackBoxFiles, WideSpan, Other, IndustrialClip, VerifiedDimensions, BackToBack, IndustrialRacks, OtherStr, PostType, VerifiedDimensionsStr, OverallDepth, OverallLength, OverallHeight, NoOfShelves ) >

                                <!ELEMENT OrderInfoRoom ( NewConstruction, AmericanDisability, ComputerFloor, AttachGridDrawing, RecessedOptions, ComponentLength, FloorMaterial, CarpetChoice, HeightDepthRatio, ClearHeight, Comments ) >

                                <!ELEMENT OrderInformation ( #PCDATA | BlanketRelease | Delivery | Installation | NonSSCShelving | OrderInfoRoom | Project )* >

                                <!ELEMENT OrderNumber ( #PCDATA ) >

                                <!ELEMENT OrderType ( #PCDATA ) >

                                <!ELEMENT OrderTypeProject ( #PCDATA ) >

                                <!ELEMENT Other ( #PCDATA ) >

                                <!ELEMENT OtherItems EMPTY >

                                <!ELEMENT OtherStr EMPTY >

                                <!ELEMENT OverallDepth EMPTY >

                                <!ELEMENT OverallHeight EMPTY >

                                <!ELEMENT OverallLength EMPTY >

                                <!ELEMENT PONo ( #PCDATA ) >

                                <!ELEMENT PartNo ( #PCDATA ) >

                                <!ELEMENT Phone ( #PCDATA ) >

                                <!ELEMENT PlanningComments EMPTY >

                                <!ELEMENT Position ( #PCDATA | Description | Group )* >

                                <!ELEMENT PostCase ( #PCDATA ) >

                                <!ELEMENT PostType EMPTY >

                                <!ELEMENT Price ( #PCDATA ) >

                                <!ELEMENT ProjAddProjName ( #PCDATA ) >

                                <!ELEMENT ProjAddSSCOrderNo ( #PCDATA ) >

                                <!ELEMENT ProjName ( #PCDATA ) >

                                <!ELEMENT Project ( ProjName, ContactName, Phone, PONo, ProjectNo, RSPNo, SalesmanName, Salesman2Name, Salesman3Name, ACPONo, NationalAccountAgreement, Agreement, AccountType, HealthCare, Government, Other, GovAccount, LvlGov, GSA, HasContractAgreement, ContractType, ContractName, ContractSSC, ContractNumber, IsMilitaryBase, BaseLocation, BaseName, BaseType, ManufactureOrStorage, QS, SpecialQuote, UseOldPricing, ExtranetLeadOrProj, LeadOrProj, AddExistingSystem, ProjAddSSCOrderNo, ProjAddProjName, DrawnBy, SICCode, Comments, BidDueDate, ConfirmedSettings, CustomerCompany, NationalAccountNo, NationalAccountSubID, SalesRep1, SalesRep2, SalesRep3, System, SystemType, SIC, Location, CollectPrepaid, RefersTo, AddOn, OrderType, OrderTypeProject, BlanketOrRegular, CarrierCode, SourceEmail, CustomerNumber, ShipRequestDate, RFShipRequestDate, OrderNumber, Status, ForceOrder ) >

                                <!ELEMENT ProjectNo ( #PCDATA ) >

                                <!ELEMENT QS ( #PCDATA ) >

                                <!ELEMENT Qty ( #PCDATA ) >

                                <!ELEMENT RFShipRequestDate ( #PCDATA ) >

                                <!ELEMENT RSPNo ( #PCDATA ) >

                                <!ELEMENT RailFloorDate ( #PCDATA ) >

                                <!ELEMENT RecessedOptions ( #PCDATA ) >

                                <!ELEMENT RefersTo EMPTY >

                                <!ELEMENT ReleaseNumber ( #PCDATA ) >

                                <!ELEMENT Relocation ( #PCDATA ) >

                                <!ELEMENT RequireSupervision ( #PCDATA ) >

                                <!ELEMENT SCOLOR ( #PCDATA ) >

                                <!ELEMENT SIC ( #PCDATA ) >

                                <!ELEMENT SICCode ( #PCDATA ) >

                                <!ELEMENT SalesRep1 ( #PCDATA ) >

                                <!ELEMENT SalesRep2 ( #PCDATA ) >

                                <!ELEMENT SalesRep3 ( #PCDATA ) >

                                <!ELEMENT Salesman2Name ( #PCDATA ) >

                                <!ELEMENT Salesman3Name EMPTY >

                                <!ELEMENT SalesmanName ( #PCDATA ) >

                                <!ELEMENT ShipPromiseDate ( #PCDATA ) >

                                <!ELEMENT ShipRequestDate ( #PCDATA ) >

                                <!ELEMENT ShipToAddress1 ( #PCDATA ) >

                                <!ELEMENT ShipToAddress2 ( #PCDATA ) >

                                <!ELEMENT ShipToAddress3 ( #PCDATA ) >

                                <!ELEMENT ShipToAddressCity ( #PCDATA ) >

                                <!ELEMENT ShipToAddressState EMPTY >

                                <!ELEMENT ShipToAddressZIP ( #PCDATA ) >

                                <!ELEMENT ShipToContact ( #PCDATA ) >

                                <!ELEMENT ShipToPhone ( #PCDATA ) >

                                <!ELEMENT SourceEmail EMPTY >

                                <!ELEMENT SpecialQuote ( #PCDATA ) >

                                <!ELEMENT StackBoxFiles ( #PCDATA ) >

                                <!ELEMENT Status ( #PCDATA ) >

                                <!ELEMENT System ( #PCDATA ) >

                                <!ELEMENT SystemType EMPTY >

                                <!ELEMENT UOM ( #PCDATA ) >

                                <!ELEMENT UnitPrice ( #PCDATA ) >

                                <!ELEMENT UseOldPricing ( #PCDATA ) >

                                <!ELEMENT VerifiedDimensions ( #PCDATA ) >

                                <!ELEMENT VerifiedDimensionsStr EMPTY >

                                <!ELEMENT WideSpan ( #PCDATA ) >

                                <!ELEMENT characteristics EMPTY >

                                <!ELEMENT materialStored ( #PCDATA ) >";

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

亚希 2024-10-28 02:52:42

在 DTD 中,我将 : 切换

<!ELEMENT characteristics EMPTY >

为 :

<!ELEMENT characteristics ANY >

这是 xml 的相关部分:

 <characteristics></characteristics>

in the DTD, I switched this :

<!ELEMENT characteristics EMPTY >

to :

<!ELEMENT characteristics ANY >

this is the portion of the xml concerned :

 <characteristics></characteristics>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文