[ SuperC @ 08.01.2008. 21:18 ] @
Napisao sam dva jednostavna koda u XMLu i oba su, barem je tako server na kojem testiram pokazali da nemaju gresku, sada bi trebao uraditi transformaciju pomocu XSLT ova dva XML fajla. U oba smjera: znaci fajl prvi u fajl drugi i fajl drugi u fajl prvi. Ima li neko ideju zasto mi konstantno prijavljuje sljedecu gresku i kako je rijesiti: Code: Found a top-level element abgabe with null namespace URI Ispod postavljam oba XML fajla i kako sam transformirao tj stavio fajlove jedan u drugi: XML1 Code: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE abgabe SYSTEM "Abgabe.dtd"> <abgabe> <projekt> <opis>Keine Dokumentation keiner Webapplikation</opis> <benutzer> <Bilder> <scale1>1x1</scale1> <scale2>2x1</scale2> <scale3>1x2</scale3> <scale4>2x2</scale4> </Bilder> </benutzer> <pixelitem> <owner>ahmet</owner> <name>proba</name> <id>0.1</id> <Desc>slika</Desc> <link>http://nowhere.com</link> <img-path>http://imageshack.us</img-path> <hScale>34</hScale> <hScaleto>4</hScaleto> <vScale>34</vScale> <vScaleto>4</vScaleto> </pixelitem> <status> <abgabetoolstatus>CLOSED</abgabetoolstatus> </status> </projekt> </abgabe> XML2 Code: <!DOCTYPE pixelboard SYSTEM "Abgabe.dtd"> <pixelboard name= "/SuperPixel"> <pixelitem name="erstes Bild"> <user name="Susi"> <guest id="1625" /> <bild name="bild1"> <description>Mein schönstes Urlaubsfoto</description> <image-path>/img/bild1.jpg</image-path> <image-position> <x-from>20</x-from> <x-to>30</x-to> <y-from>30</y-from> <y-to>30</y-to> </image-position> </bild> </user> </pixelitem> <pixelitem name="zweites Bild"> <user name="Willi"> <guest id="2645" /> <bild name="bild2"> <description>Meine Geburtstagsfeier</description> <image-path>/img/bild2.jpg</image-path> <image-position> <x-from>20</x-from> <x-to>30</x-to> <y-from>30</y-from> <y-to>30</y-to> </image-position> </bild> </user> </pixelitem> <projekt> <opis>Keine Dokumentation keiner Webapplikation</opis> <benutzer> <Bilder> <scale1>1x1</scale1> <scale2>2x1</scale2> <scale3>1x2</scale3> <scale4>2x2</scale4> </Bilder> </benutzer> <pixelitem> <owner>ahmet</owner> <name>proba</name> <id>0.1</id> <Desc>slika</Desc> <link>http://nowhere.com</link> <img-path>http://imageshack.us</img-path> <hScale>34</hScale> <hScaleto>4</hScaleto> <vScale>34</vScale> <vScaleto>4</vScaleto> </pixelitem> <status> <abgabetoolstatus>CLOSED</abgabetoolstatus> </status> </projekt> </pixelboard> XSLT (gdje XML1 ide u XML2) Code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <pixelboard name= "SuperPixel"> <pixelitem name="erstes Bild"> <user name="Susi"> <guest id="1625" /> <bild name="bild1"> <description>Mein schönstes Urlaubsfoto</description> <image-path>/img/bild1.jpg</image-path> <image-position> <x-from>20</x-from> <x-to>30</x-to> <y-from>30</y-from> <y-to>30</y-to> </image-position> </bild> </user> </pixelitem> <pixelitem name="zweites Bild"> <user name="Willi"> <guest id="2645" /> <bild name="bild2"> <description>Meine Geburtstagsfeier</description> <image-path>/img/bild2.jpg</image-path> <image-position> <x-from>20</x-from> <x-to>30</x-to> <y-from>30</y-from> <y-to>30</y-to> </image-position> </bild> </user> </pixelitem> <projekt> <opis>Keine Dokumentation keiner Webapplikation</opis> <benutzer> <Bilder> <scale1>1x1</scale1> <scale2>2x1</scale2> <scale3>1x2</scale3> <scale4>2x2</scale4> </Bilder> </benutzer> <pixelitem> <owner>ahmet</owner> <name>proba</name> <id>0.1</id> <Desc>slika</Desc> <link>http://nowhere.com</link> <img-path>http://imageshack.us</img-path> <hScale>34</hScale> <hScaleto>4</hScaleto> <vScale>34</vScale> <vScaleto>4</vScaleto> </pixelitem> <status> <abgabetoolstatus>CLOSED</abgabetoolstatus> </status> </projekt> </pixelboard> </xsl:stylesheet> XSLT (gdje XML2 ide u XML1) Code: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="Abgabe.dtd"> <xsl:template match="projekt"> <opis>Keine Dokumentation keiner Webapplikation</opis> <benutzer> <Bilder> <scale1>1x1</scale1> <scale2>2x1</scale2> <scale3>1x2</scale3> <scale4>2x2</scale4> </Bilder> </benutzer> <pixelitem> <owner>ahmet</owner> <name>proba</name> <id>0.1</id> <Desc>slika</Desc> <link>http://nowhere.com</link> <img-path>http://imageshack.us</img-path> <hScale>34</hScale> <hScaleto>4</hScaleto> <vScale>34</vScale> <vScaleto>4</vScaleto> </pixelitem> <status> <abgabetoolstatus>CLOSED</abgabetoolstatus> </status> </xsl:template>xsl:pixelboard name="SuperPixel"> <pixelitem name="erstes Bild"> <user name="Susi"> <guest id="1625"></guest> <bild name="bild1"> <description>Mein schönstes Urlaubsfoto</description> <image-path>/img/bild1.jpg</image-path> <image-position> <x-from>20</x-from> <x-to>30</x-to> <y-from>30</y-from> <y-to>30</y-to> </image-position> </bild> </user> </pixelitem> <pixelitem name="zweites Bild"> <user name="Willi"> <guest id="2645"></guest> <bild name="bild2"> <description>Meine Geburtstagsfeier</description> <image-path>/img/bild2.jpg</image-path> <image-position> <x-from>20</x-from> <x-to>30</x-to> <y-from>30</y-from> <y-to>30</y-to> </image-position> </bild> </user> </pixelitem> </xsl:template> </xsl:stylesheet> [Ovu poruku je menjao SuperC dana 08.01.2008. u 22:42 GMT+1] [Ovu poruku je menjao SuperC dana 08.01.2008. u 23:40 GMT+1] [Ovu poruku je menjao SuperC dana 08.01.2008. u 23:49 GMT+1] [Ovu poruku je menjao SuperC dana 09.01.2008. u 22:11 GMT+1] |