Announcement

Collapse
No announcement yet.

xml externe dateninsel

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • xml externe dateninsel

    Hi,

    ich arbeite gerade das Buch "xml - extensible markup language von anfang
    an" durch und bekomme bei einem Beispiel nicht das angezeigt wie es sein
    sollte (siehe screenshot 1). Wie man auf dme Screenshot sehen kann ist
    die tabelle leer , es sollten eigentlich die Daten aus der xml Datei
    bspl017.xml herausgefiltert werden. mir ist beim quellcode aufgefallen
    das in bspl018.htm das Tag <adressen> gar nicht verwendet wird
    vielleicht liegt darin der Fehler? bin noch anfänger bei xml hoffe jemand kann mir weiterhelfen.

    PS: ich habe zum anzeigen internet explorer 8 und firefox 3.6.13 benutzt
    aber beides mal das gleiche ergebnis

    hier der code zu Bspl017.xml:
    Code:
    <?xml version="1.0" encoding="utf-8" ?>
    <!-- Bspl017.xlm -->
    <adressen>
    	<eintrag>
    		<bereich>Einkauf</bereich>
    		<name>Maria Meier</name>
    		<mail>[email protected]</mail>
    	</eintrag>
    	<eintrag>
    		<bereich>Einkauf</bereich>
    		<name>Paul Peters</name>
    		<mail>[email protected]</mail>
    	</eintrag>
    	<eintrag>
    		<bereich>Verkauf</bereich>
    		<name>Hans Schmitz</name>
    		<mail>[email protected]</mail>
    	</eintrag>
    	<eintrag>
    		<bereich>Verkauf</bereich>
    		<name>Willi Schmidt</name>
    		<mail>[email protected]</mail>
    	</eintrag>
    	<eintrag>
    		<bereich>Verkauf</bereich>
    		<name>Karl Kaiser</name>
    		<mail>[email protected]</mail>
    	</eintrag>
    	<eintrag>
    		<bereich>Technik</bereich>
    		<name>Otto Muster</name>
    		<mail>[email protected]</mail>
    	</eintrag>
    </adressen>
    Code zu Bspl018.htm:
    Code:
    <!-- Bspl18.htm -->
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 
    Transitional//EN">
    <html>
    	<head>
    		<title>Externe Dateninsel</title>
    	</head>
    	<body>
    		<h1>E-Mail-Adressen</h1>
    		<P>Für Fragen wenden Sie sich bitte an unsere Mitarbeiter:</P>
    		<hr>
    		<xml id="mailliste" src="Bspl017.xml"></xml>
    		<table border="1" 
    				datasrc="#mailliste" 
    				cellPadding="5">
    			<thead>
    				<tr>
    					<th>Abteilung</th>
    					<th>Name</th>
    					<th>E-Mail-Adresse</th>
    				</tr>
    			</thead>
    			<tr>
    				<td><span datafld="bereich"></span></td>
    				<td><span datafld="name"></span></td>
    				<td><span datafld="mail"></span></td>
    			</tr>
    		</table>
    		<hr>
    	</body>
    </html>
    Attached Files

  • #2
    Hallo,

    das genannte Buch programmiert _wohl_ auf einem älteren Stand. Was von heutigen Browsern so wohl nicht mehr akzeptiert wird...(Validator) Aber die alte Version von Frontpage kann die Seite darstellen, siehe Screenshot.
    Attached Files
    MfG
    Cheat-Sheets for Developers / Programming Quotes

    Comment


    • #3
      danke für die antwort ich habe diesen validator mal ausprobiert und bekomme diese fehlermeldungen:

      1. Error Line 12, Column 11: there is no attribute "ID"

      <xml id="mailliste" src="Bspl017.xml"></xml>



      You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

      This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

      How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
      2. Error Line 12, Column 27: there is no attribute "SRC"

      <xml id="mailliste" src="Bspl017.xml"></xml>



      You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

      This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

      How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
      3. Error Line 12, Column 40: element "XML" undefined

      <xml id="mailliste" src="Bspl017.xml"></xml>



      You have used the element named above in your document, but the document type you are using does not define an element of that name. This error is often caused by:
      * incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Frameset" document type to get the "<frameset>" element),
      * by using vendor proprietary extensions such as "<spacer>" or "<marquee>" (this is usually fixed by using CSS to achieve the desired effect instead).
      * by using upper-case tags in XHTML (in XHTML attributes and elements must be all lower-case).
      4. Error Line 13, Column 29: there is no attribute "DATASRC"

      <table border="1" datasrc="#mailliste" cellPadding="5">



      You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

      This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

      How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.
      5. Error Line 22, Column 23: there is no attribute "DATAFLD"

      <td><span datafld="bereich"></span></td>



      You have used the attribute named above in your document, but the document type you are using does not support that attribute for this element. This error is often caused by incorrect use of the "Strict" document type with a document that uses frames (e.g. you must use the "Transitional" document type to get the "target" attribute), or by using vendor proprietary extensions such as "marginheight" (this is usually fixed by using CSS to achieve the desired effect instead).

      This error may also result if the element itself is not supported in the document type you are using, as an undefined element will have no supported attributes; in this case, see the element-undefined error message for further information.

      How to fix: check the spelling and case of the element and attribute, (Remember XHTML is all lower-case) and/or check that they are both allowed in the chosen document type, and/or use CSS instead of this attribute. If you received this error when using the <embed> element to incorporate flash media in a Web page, see the FAQ item on valid flash.

      Comment


      • #4
        ich habe diesen validator mal ausprobiert
        Aber der setzt beim Quellcode Massstäbe von heute an. Wenn schon, dann nimmt man einen Validator von damals. Der alte IE 6 akzeptiert die Beispiele ohne Probleme (Screenshot). Neuere Entwicklungen befassen sich mehr mit XSLT, z.B. http://www.dzone.com/links/r/publish...placement.html
        Attached Files
        MfG
        Cheat-Sheets for Developers / Programming Quotes

        Comment


        • #5
          HTML als W3C-Standard kennt kein Element namens "xml" und keine Dateninseln. Das ist eine Erweiterung, die nur mit IE unterstützt wird (http://msdn.microsoft.com/en-us/libr...=VS.85%29.aspx). Mit Firefox brauchst du das Beispiel also sicher nicht zu probieren. Mit IE 8 unter Windows XP funktioniert die Datenbindung hier bei mir, keine Ahnung, warum das bei dir nicht funktioniert.

          Nachtrag: mit IE 8 funktioniert die Datenbindung, wenn ich das HTML-Dokument von einem HTTP-Server lade (also etwa http://localhost/datei.html), so ich direkt aus dem Dateisystem lade, funktioniert es nicht.

          Comment


          • #6
            danke für die rückmeldungen also mein betriebssystem ist windows 7 64 bit es liegt wohl eindeutig daran das der explorer zu neu ist, ich habe schon versucht einen inet explorer 6 zu installieren aber den gibts nur für 32 bit systeme. ich habe noch ein anderes xml buch das 2009 verfasst wurde hoffentlich werden diese beispiele besser fuktionieren

            Comment


            • #7
              Mit einem 64 bit OS kann ich nicht testen, aber http://home.arcor.de/martin.honnen/x...011022701.html zeigt mir mit IE 8 unter Windows XP und IE 9 release candidate unter Windows Vista die Daten an. Deshalb sollte das auch mit IE 8 unter Window 7 funktionieren, zumindest mit der 32 bit Version von IE.
              Aber ansonsten ist die Benutzung von XML-Dateninseln und Datenbindung nur sinnvoll, wenn man sicher ist, dass IE benutzt wird.

              Comment

              Working...
              X