Avatar billede senil Nybegynder
04. juli 2007 - 10:29 Der er 2 kommentarer og
1 løsning

Xml Schema

Hej Eksperter

Jeg roder lidt med at lave et schema til en xmlfil som jeg skal bruge.
Filen skal indeholder elementer af filer med x antal parameter pr. fil/element

<ReportFil path = "c:\xx\xx.xml">
<Parameter name = "aa" BdField = "DBaa">
<Parameter name = "bb" BdField = "DBbb">
.
.
.
<Parameter name = "xx" BdField = "DBxx">
</ReportFile>
<ReportFile path = "c:\xx\aa.xml">
.
.
.
</ReportFile>

Hvordan ser et sådan schema ud???
Avatar billede bubbaa Nybegynder
04. juli 2007 - 10:39 #1
http://w3schools.com/xml
www.w3schools.com/xsd
søg efter Altova XML spy på google

Det tror jeg vil hjælpe dig.
Avatar billede senil Nybegynder
04. juli 2007 - 13:18 #2
Se lige på dette. e 2 attributes CrParameter og DbField virker ikke....
Kan i se fejlen?

<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="SchemaReportFile" targetNamespace="http://tempuri.org/SchemaReportFile.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/SchemaReportFile.xsd" xmlns:mstns="http://tempuri.org/SchemaReportFile.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name ="Reports">
    <xs:complexType>
      <xs:sequence> 
       
        <xs:element name="CrystalReports" type="xs:string">
          <xs:complexType>
     
            <xs:sequence>
              <xs:element name="Parameter" type="xs:string">
               
                <xs:complexType>
                  <xs:sequence>
                   
               
                    <xs:attribute name="CrParameter" type="xs:string"/>
                  <xs:attribute name="DbField" type="xs:string"/>
                 
                  </xs:sequence>
                 
                </xs:complexType>
             
              </xs:element>
            </xs:sequence>
           
            <xs:attribute name="FilePath"  type="xs:string"/>
         
          </xs:complexType>
         
        </xs:element>
 
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
Avatar billede senil Nybegynder
04. juli 2007 - 13:55 #3
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="SchemaReportFile" targetNamespace="http://tempuri.org/SchemaReportFile.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/SchemaReportFile.xsd" xmlns:mstns="http://tempuri.org/SchemaReportFile.xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="CrystalReports">
    <xs:complexType>
      <xs:sequence>
        <xs:element name="crFile" minOccurs="0" maxOccurs="unbounded">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="Parameter" minOccurs="0" maxOccurs="unbounded">
                <xs:complexType>
                  <xs:attribute name="crParameterName" type="xs:string"/>
                  <xs:attribute name="dbFieldName" type="xs:string"/>
                </xs:complexType> 
              </xs:element>
            </xs:sequence>
            <xs:attribute name="FilePath" type="xs:string">
             
            </xs:attribute>
          </xs:complexType>
        </xs:element>
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester