bxe_xpath problem
[email protected] Mon, 6 Dec 2004 18:04:05 +0200
| Newsgroups | gmane.editors.bitflux.general |
|---|---|
| Message-ID | <[email protected]> |
Hallo
Ich versuche folgendes:
--------------sample.xml -----------BEGIN
<?xml version="1.0" encoding="UTF-8" ?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Kerasmena</title>
<artist>Bassilis Papakonstantinou</artist>
<country>Hellas</country>
<company>Den Gnoriso</company>
<price>9,50</price>
<year>2004</year>
</cd>
<autor>
<name>Apostolos Anagnostopoulos</name>
<adress>kapou 12</adress>
<postal>12345</postal>
<city>Athina</city>
</autor>
</catalog>
--------------sample.xml -----------END
--------------sample.php--------------BEGIN
<html>
<head>
<title> PARADEIGMA XML+XSD+XSL+PHP </title>
<link rel="stylesheet" type="text/css" href="main.css" media="screen"
/>
<script src="../../bxeLoader.js" type="text/javascript"> </script>
</head>
<body onload="bxe_start('./config.xml')">
<br>
<?php
require_once('./domit/xml_domit_include.php');
$cdCollection = new DOMIT_Document();
$success = $cdCollection->loadXML("./sample.xml");
$myNodeName = $cdCollection->documentElement->nodeName;
$myElements =& $cdCollection->getElementsByPath("/catalog/cd");
$total = $myElements->getLength();
for ($i = 0; $i < $total; $i++) {
$currNod =& $myElements->item($i);
while (list($key, $val) = each($currNod->childNodes)) {
echo "$key => $val->nodeName ";
echo
"/".$myNodeName."/".$currNod->nodeName."/".$currNod->childNodes[$key]->nodeName;
echo ":".$currNod->childNodes[$key]->getText()."<br>";;
$Xedit="/".$myNodeName."/".$currNod->nodeName."/".$currNod->childNodes[$key]->nodeName;
print("<div id=\"title\" bxe_xpath=\"$Xedit\"> </div>");
}
}
?>
</body>
</html>
--------------index.php--------------END
--------------config.xml-------------BEGIN
<input>
<!-- The XML-document with the actual data -->
-- <file name="BX_xmlfile">./loadsave.php?XML=./sample.xml</file>
<file name="BX_xmlfile">sample.xml</file>
<file name="BX_validationfile">sample.rng</file>
</input>
-------------config.xml-------------END
wenn ich sample.php lade bekomme ich folgendes:
-----------------------------ANFANG---------------------------
0 => title /catalog/cd/title:Empire Burlesque
Empire BurlesqueKerasmena
1 => artist /catalog/cd/artist:Bob Dylan
Bob DylanBassilis Papakonstantinou
2 => country /catalog/cd/country:USA
USAHellas
3 => company /catalog/cd/company:Columbia
ColumbiaDen Gnoriso
4 => price /catalog/cd/price:10.90
10.909,50
5 => year /catalog/cd/year:1985
19852004
0 => title /catalog/cd/title:Kerasmena
Empire BurlesqueKerasmena
1 => artist /catalog/cd/artist:Bassilis Papakonstantinou
Bob DylanBassilis Papakonstantinou
2 => country /catalog/cd/country:Hellas
USAHellas
3 => company /catalog/cd/company:Den Gnoriso
ColumbiaDen Gnoriso
4 => price /catalog/cd/price:9,50
10.909,50
5 => year /catalog/cd/year:2004
19852004
-----------------------------ANFANG---------------------------
Warum bekomme ich alles was im /catalog/cd insgesamt existiert und nicht nur das
was
echo
"/".$myNodeName."/".$currNod->nodeName."/".$currNod->childNodes[$key]->nodeName;
herausgibt?
Hat jemand den gleichen Problem irgendwie geloescht?
----------------------------------------------------------------
This message was sent through the TEI of ATHENS by means of NOC.
--
bx-editor-users mailing list
[email protected]
http://lists.bitflux.ch/cgi-bin/listinfo/bx-editor-users