πρόβλημα με xml

Σε αυτή την περιοχή μπορείτε να βρείτε ή να αναζητήσετε πληροφορίες σχετικές με την PHP

Συντονιστές: WebDev Moderators, Super-Moderators, PHP Moderators

Απάντηση
gtze
Δημοσιεύσεις: 36
Εγγραφή: 15 Ιουν 2005 19:15
Τοποθεσία: Alimos
Επικοινωνία:

πρόβλημα με xml

Δημοσίευση από gtze » 04 Νοέμ 2005 20:58

Δεν ξέρω αν είναι το κατάλληλο Forum για την ερώτηση αυτή αλλα
έχω ένα πρόβλημα.
Εχώ ένα script το οποίο δημηουργεί xml.

υπάρχει όμως ένας χαρακτήρας < ο οποίος δημιουργεί προβλήμα.

στο κάτω μέρος της σελίδας : LINK θα δείτε το σφάλμα

μπορεί κάποιος να βοηθήσει?

Άβαταρ μέλους
Rapid-eraser
WebDev Moderator
Δημοσιεύσεις: 6851
Εγγραφή: 05 Απρ 2003 17:50
Τοποθεσία: Πειραιάς
Επικοινωνία:

πρόβλημα με xml

Δημοσίευση από Rapid-eraser » 04 Νοέμ 2005 21:10

katarxiv baze newline \n stis grammes sou gia va bgazeis akri sto source :P
Stnv sivexeia sta data twv eggrafwv sou perva tis apo html entities oste va metafrazeis tous xaraktires pou eivai controle se entities morfi kai va miv xtipaei

8a mporouses epipis va bazeis se ka8e keli
to tag pou leei va miv koitaei ta periexomeva sav control alla sav data alla tsampa overhead

so

try tnv htmlspecialchars() gia va kaveis afti tnv metatropi
Cu, Rapid-eraser, Tα αγαθά copies κτώνται.
Love is like oxygen, You get too much you get too high
Not enough and you're gonna die, Love gets you high

gtze
Δημοσιεύσεις: 36
Εγγραφή: 15 Ιουν 2005 19:15
Τοποθεσία: Alimos
Επικοινωνία:

πρόβλημα με xml

Δημοσίευση από gtze » 05 Νοέμ 2005 00:35

Σ' ευχαριστώ για την γρήγορη απάντηση
αλλα δυστηχώς δεν κατάλαβα πολλά πράγματα.
Αν σου στείλω τη σελίδα με τον code που χρησιμοποιώ για τη δημιουργία το xml θα μπορούσες να κάνεις κάτι με την htmlspecialchars

Άβαταρ μέλους
Rapid-eraser
WebDev Moderator
Δημοσιεύσεις: 6851
Εγγραφή: 05 Απρ 2003 17:50
Τοποθεσία: Πειραιάς
Επικοινωνία:

πρόβλημα με xml

Δημοσίευση από Rapid-eraser » 05 Νοέμ 2005 09:51

av 8es kavti attache edw :)
Ypo8eto dev exeis kati va kripseis opote 8a eivai efkeria va dei kai kapoios allos to paradigma afto.
Cu, Rapid-eraser, Tα αγαθά copies κτώνται.
Love is like oxygen, You get too much you get too high
Not enough and you're gonna die, Love gets you high

gtze
Δημοσιεύσεις: 36
Εγγραφή: 15 Ιουν 2005 19:15
Τοποθεσία: Alimos
Επικοινωνία:

πρόβλημα με xml

Δημοσίευση από gtze » 05 Νοέμ 2005 10:53

Σ' ευχαριστώ . Ο κώδικας που χρησιμποποιώ ειναι αυτός παρακάτω .Το σφάλμα που βγάζει μπορείς να το δεις στη σελίδα https://www.luxe.gr/xml2.php

Κώδικας: Επιλογή όλων

<?php

//----------------------------------------------------------------------------------------------
// THE FOLLOWING OPTIONS MUST BE CONFIGURED!
//----------------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------------
// 	1. Setup OSC Link
//----------------------------------------------------------------------------------------------
//  If you have placed this file in the SAME directory as your OS Commerce shop then 
//  SKIP TO SECTION 2

//  If you have placed this file away from your OS Commerce directory please enter the path
//  to the file "application_top.php" which is in the includes directory of your OSC installation&#58;

	$osc_path	= 	"includes/application_top.php";

//----------------------------------------------------------------------------------------------
//	2. Configure Site Info
//----------------------------------------------------------------------------------------------
//	Enter the url to your website - do not put 'http&#58;//' or enter any slashes
	$domain_name 	= 	"www.luxe.gr";	// NO SLASHES - EG&#58; www.mysite.com 
//	Enter the folder name of your shop directory, this is normally 'catalog'
//	$catalog_folder	=	"catalog"; // default is 'catalog' - NO SLASHES!
//	If your shop is in your site root &#40;EG&#58; www.mysite.com/index.php&#41; then uncomment the next line.
	$catalog_folder	=	"";    
//	Enter the folder name of your product images directory, this is normally 'images'
	$image_folder	=	"images"; // NO SLASHES!

//----------------------------------------------------------------------------------------------
//	3. Ouput Options&#58;
//----------------------------------------------------------------------------------------------
//	I have rewrote the sql queries to allow easier configuration of which values you wish to be 
//	included in the XML output. These options can easily be turned on or off.
//----------------------------------------------------------------------------------------------
//	For each value you wish to be included in the feed change the value to 1 like&#58;
//	$product_price 			= "1";	// Include Product's Price - &#40;1 = YES | 0 = NO&#41; 
//	For each value you DO NOT want to be included in the feed change the value to 0 like&#58;
//	$product_price 			= "0";	// Include Product's Price - &#40;1 = YES | 0 = NO&#41; 
//----------------------------------------------------------------------------------------------
	$show_creation_time		= "1";  // Include date and time tag that displays when the xml feed was run. - &#40;1 = YES | 0 = NO&#41;
	$product_name 			= "1";	// Include Product's Name/Title - &#40;1 = YES | 0 = NO&#41; 
	$product_price 			= "1";	// Include Product's Price - &#40;1 = YES | 0 = NO&#41; 
	$product_manufacturer	= "1";	// Include Product's Manufacturer Name - &#40;1 = YES | 0 = NO&#41; 
	$product_weight			= "1";  // Include Product's Weight - &#40;1 = YES | 0 = NO&#41; 	
	$product_model			= "1";  // Include Product's Model Number - &#40;1 = YES | 0 = NO&#41; 			
	$product_quantity		= "1";  // Include Quantity In Stock - &#40;1 = YES | 0 = NO&#41; 
	$product_image			= "1";  // Include link to products image? - &#40;1 = YES | 0 = NO&#41; 			
	$product_info_link 		= "1";  // Include link to product_info.php at your website? - &#40;1 = YES | 0 = NO&#41; 
	$product_date_added		= "1";  // Include date product was added - &#40;1 = YES | 0 = NO&#41; 			
	$product_date_modified	= "1";  // Include date product was modified - &#40;1 = YES | 0 = NO&#41; 			
	$product_date_available	= "1";  // Include date product is available - &#40;1 = YES | 0 = NO&#41; 			

// 	By default the XML feed will only display products which are set as active 
//  &#40;green light next to product name in OSC Admin&#41; - If you wish to output INACTIVE products then
//  change the following value to 1 &#40;eg&#58; 	$allow_all = "1"; &#41;, otherwise leave unchanged.
	$allow_all				= "0"; 
// 	By default only products that are in stock and have a quantity of 1 or more will be displayed.
//  If you wish to output OUT OF STOCK &#40;0 quantity&#41; products then change the following value to 1 
//  &#40;eg&#58; 	$allow_no_stock = "1"; &#41;, otherwise leave unchanged.
	$allow_no_stock			= "0"; 
//----------------------------------------------------------------------------------------------
//	4. XML Element Names
//----------------------------------------------------------------------------------------------	
//	This section is provided for users who will use xml parsers that require predetermined tag names
//  or tag names that need to be in other languages apart from English. 
//  DO NOT CHANGE THESE NAMES UNLESS YOU HAVE TO!	
	$xml_tags&#91;'master'&#93;			= 	"STOREITEMS";	// Master tag&#58; 									<STOREITEMS>
	$xml_tags&#91;'time'&#93;			= 	"CREATED";		// Feed creation date/time Tag&#58; 				<CREATED>
	$xml_tags&#91;'product'&#93;		=	"PRODUCT";		// Product Container Tag&#58; 						<PRODUCT ITEM="xxx">
	$xml_tags&#91;'name'&#93;			=	"NAME";			// Product's Name/Title in Product Container&#58;	<NAME>
	$xml_tags&#91;'price'&#93;			=	"PRICE";		// Price tag in Product Container&#58; 				<PRICE>
	$xml_tags&#91;'manufacturer'&#93;	=	"MANUFACTURER";	// Product Image URL in Product Container&#58; 		<IMAGE_URL>
	$xml_tags&#91;'weight'&#93;			=	"WEIGHT";		// Weight tag in Product Container&#58; 			<WEIGHT>
	$xml_tags&#91;'model'&#93;			=	"MODEL";		// Model tag in Product Container&#58; 				<MODEL>
	$xml_tags&#91;'quantity'&#93;		=	"QUANTITY";		// Quantity tag in Product Container&#58; 			<QUANTITY>
	$xml_tags&#91;'url'&#93;			=	"URL";			// Product Info Page URL in Product Container&#58; 	<URL> 			
	$xml_tags&#91;'image_url'&#93;		=	"IMAGE_URL";	// Product Image URL in Product Container&#58; 		<IMAGE_URL>
	$xml_tags&#91;'added'&#93;			=	"ADDED";		// Date Product Added in Product Container&#58; 	<ADDED>
	$xml_tags&#91;'modified'&#93;		=	"MODIFIED";		// Date Product Modfied in Product Container&#58; 	<MODIFIED>
	$xml_tags&#91;'available'&#93;		=	"AVAILABLE";	// Date Product Available in Product Container&#58;	<AVAILABLE>
//----------------------------------------------------------------------------------------------
//	5. PRICING
//----------------------------------------------------------------------------------------------	
//	This section controls pricing options. You can set a TAX rate then activate it so that all 
//  default product prices with have the tax added on to the products price. You can also specify
// if you want to disp&#91;lay special discounted prices or not.
//----------------------------------------------------------------------------------------------	
// VAT OPTIONS&#58;
	$pricing_vat_rate		= 	"19";	// Enter Tax Rate to add to Products Price 
										// &#40;e.g&#58; To add 17.5% on all product prices enter "17.5"
										// NOTE&#58; To activate VAT you must TURN ON the next option below!
	
	$pricing_add_vat		=	"1";	// Activate TAX on all product prices - DEFAULT IS OFF || &#40;1 = YES | 0 = NO&#41;
										// To activate TAX change the value to 1 &#40;e.g&#58; $pricing_add_vat = "1";
//----------------------------------------------------------------------------------------------	
// PRICE SPECIALS OPTIONS&#58;
	
	$pricing_show_specials	=	"1";	// Show products special discounted price instead of normal; product price
										// when available - DEFAULT IS OFF || &#40;1 = YES | 0 = NO&#41;
//----------------------------------------------------------------------------------------------
//	6. Include CATEGORY element container
//----------------------------------------------------------------------------------------------
//	If you turn this on each new category cycle will contain a CATEGORY tag eg&#58;
//	<CATEGORY id="1" name="Books > Non Fiction">
//		<PRODUCT>....</PRODUCT>
//	</CATEGORY> 
	$category_container			= 	"1";			// &#40;1 = YES | 0 = NO&#41; 
	$category_container_id		= 	"1";			// Include Category ID 		&#40;eg&#58; id="1"&#41; in <CATEGORY> tag
	$category_container_name	=	"1";			// Include Category Name 	&#40;eg&#58; name="Books > Non Fiction"&#41; in <CATEGORY> tag
	$xml_tags&#91;'category'&#93;		=	"CATEGORY";		// Category Container Tag Name&#58;	<CATEGORY id="xx" name="xxx">

//----------------------------------------------------------------------------------------------
// END OF CONFIGURATION AREA 
//----------------------------------------------------------------------------------------------

////////////////////////////////////////////////////////////////////////////////////////////////
// *** IF YOU NEED TO ADD CUSTOM TAGS AND NEED HELP PLEASE SEE ADVANCED.HTM OR VISIT&#58; 
// *** http&#58;//forums.oscommerce.com/index.php?showtopic=146810         *** 
// *** PLEASE DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOU ARE DOING                 ***
////////////////////////////////////////////////////////////////////////////////////////////////
require&#40;$osc_path&#41;;
Header&#40; 'Content-Type&#58; text/xml' &#41;; 
echo '<?xml version="1.0" encoding="ISO-8859-7"?>'; 
echo '<' . $xml_tags&#91;'master'&#93; . '>';
if &#40;$show_creation_time == 1&#41; &#123;
$timestamp = date&#40;"D M j G&#58;i&#58;s T Y"&#41;; 
echo '<' . $xml_tags&#91;'time'&#93; . ' value="' . $timestamp . '">';
&#125;
	$connection = mysql_connect&#40;DB_SERVER, DB_SERVER_USERNAME, DB_SERVER_PASSWORD&#41; or die&#40;"OSC XML FEED FAILURE - Couldn't make connection to local database."&#41;;
	$db = mysql_select_db&#40;DB_DATABASE, $connection&#41; or exit&#40;"OSC XML FEED FAILURE - Error code&#58; " . mysql_errno&#40;$connection&#41; . " Error&#58; " . mysql_error&#40;$connection&#41;  . "."&#41;;
	$category_query = "SELECT DISTINCT `categories_description`.`categories_name`,`categories_description`.`categories_id`,`categories_description1`.`categories_name` AS `categories_name1`,`categories`.`categories_id` FROM `categories_description` INNER JOIN `categories` ON &#40;`categories_description`.`categories_id` = `categories`.`categories_id`&#41; INNER JOIN `categories_description` `categories_description1` ON &#40;`categories`.`parent_id` = `categories_description1`.`categories_id`&#41; ORDER BY 'categories_id' ASC";
	$category_query = "SELECT DISTINCT `categories_description`.`categories_name`,`categories_description`.`categories_id`,`categories`.`parent_id` FROM `categories_description`INNER JOIN `categories` ON &#40;`categories_description`.`categories_id` = `categories`.`categories_id`&#41; ORDER BY `categories_id`";
	
	$category_query_result = mysql_query&#40;$category_query,$connection&#41; or die&#40;"Database Query Failed during Category Query."&#41;;
	while &#40;$row = mysql_fetch_array&#40;$category_query_result&#41;&#41; &#123;
 	$product_query 			= "SELECT DISTINCT `products`.`products_id`,`products`.`products_quantity`,`products`.`products_model`,`products`.`products_image`,`products`.`products_price`,`products`.`products_date_added`,`products`.`products_last_modified`,`products`.`products_date_available`,`products`.`products_weight`,`products`.`products_status`,`products`.`manufacturers_id`,`products_description`.`products_name`,`products_description`.`products_url`,`categories_description`.`categories_name`,`manufacturers`.`manufacturers_name` FROM `products` INNER JOIN `products_description` ON &#40;`products`.`products_id` = `products_description`.`products_id`&#41; INNER JOIN `products_to_categories` ON &#40;`products_description`.`products_id` = `products_to_categories`.`products_id`&#41; INNER JOIN `categories_description` ON &#40;`products_to_categories`.`categories_id` = `categories_description`.`categories_id`&#41; LEFT JOIN `manufacturers` ON &#40;`products`.`manufacturers_id` = `manufacturers`.`manufacturers_id`&#41; 
							   WHERE &#40;`products_to_categories`.`categories_id` = " . $row&#91;'categories_id'&#93; . "&#41;";
	if&#40;$allow_all		==	"0"&#41;	&#123;	$product_query	.= " AND &#40;`products`.`products_status` = 1&#41;"; 	&#125;
	if&#40;$allow_no_stock	==	"0"&#41;	&#123;	$product_query	.= " AND &#40;`products`.`products_quantity` > 0&#41;"; &#125;
	$product_query_result 	= mysql_query&#40;$product_query,$connection&#41; or exit&#40;"<hr>code&#58; " . mysql_errno&#40;$connection&#41; . " error&#58; " . mysql_error&#40;$connection&#41;  . "."&#41;;
	$product_query_count	= mysql_numrows&#40;$product_query_result&#41;;
		if &#40;$product_query_count > 0&#41; &#123;
		if &#40;$row&#91;'parent_id'&#93; > 0 &#41; &#123;
			$parent_category_query = "SELECT `categories_description`.`categories_name`FROM  `categories_description`WHERE  &#40;`categories_description`.`categories_id` = " . $row&#91;'parent_id'&#93; . "&#41;";
			$parent_category_query_result = mysql_query&#40;$parent_category_query,$connection&#41; or die&#40;"Database Query Failed during Parent Category Query."&#41;;
			$parent = mysql_fetch_array&#40;$parent_category_query_result&#41;;
			$row&#91;'categories_name'&#93; = $parent&#91;'categories_name'&#93; . ' > ' . $row&#91;'categories_name'&#93;;
	&#125;
	$row&#91;'categories_name'&#93;	= ereg_replace &#40;"&", " and ", $row&#91;'categories_name'&#93;&#41;;
	if &#40;$category_container	== "1"&#41;	&#123;
		$cattag =  "<" . $xml_tags&#91;'category'&#93;; 
		if &#40;$category_container_id == "1"&#41;		&#123;	$cattag .=  " id='" . $row&#91;'categories_id'&#93;. "'";		&#125;
		if &#40;$category_container_name == "1"&#41;	&#123;	$cattag .=  " name='" . $row&#91;'categories_name'&#93; . "'";					&#125;
		$cattag .=  ">";
		echo $cattag; 
	&#125;
	while &#40;$row = mysql_fetch_array&#40;$product_query_result&#41;&#41; &#123;
	//----------------------------------------------------------------------------------------------
	// START -> insert any custom sql queries for extra tags here
	//----------------------------------------------------------------------------------------------

	//----------------------------------------------------------------------------------------------
	// END   -> insert any custom sql queries for extra tags here
	//----------------------------------------------------------------------------------------------

		if &#40;$pricing_show_specials == 1&#41; &#123;
			$specials_query 		= "SELECT `specials`.`specials_new_products_price` FROM `specials` WHERE  &#40;`specials`.`products_id` = " . $row&#91;'products_id'&#93; . "&#41;";
			$specials_result 		=	mysql_query&#40;$specials_query,$connection&#41; or exit&#40;"<hr>code&#58; " . mysql_errno&#40;$connection&#41; . " error&#58; " . mysql_error&#40;$connection&#41;  . "."&#41;;
			$specials_query_count	= 	mysql_numrows&#40;$specials_result&#41;;
			if &#40;$specials_query_count > 0&#41; &#123;
				$specials = mysql_fetch_array&#40;$specials_result&#41;;
				$row&#91;'products_price'&#93;	=	$specials&#91;'specials_new_products_price'&#93;;	
			&#125;
		&#125;
		if &#40;$pricing_add_vat == 1&#41; &#123; 
		$temp_tax 					= &#40;$row&#91;'products_price'&#93; / 100&#41; * $pricing_vat_rate;
		$row&#91;'products_price'&#93; 		= $row&#91;'products_price'&#93; + $temp_tax;
		&#125;
		$row&#91;'products_price'&#93;	= tep_round&#40;$row&#91;'products_price'&#93;, 2&#41;;
	// search and replace characters from data which xml will not process
  	if &#40;$product_name == 1&#41; &#123;
	$row&#91;'products_name'&#93;	= ereg_replace &#40;"&", " and ", $row&#91;'products_name'&#93;&#41;;
  	$row&#91;'products_name'&#93;	= ereg_replace &#40;"&reg;", "&#40;R&#41;", $row&#91;'products_name'&#93;&#41;;
  	$row&#91;'products_name'&#93;	= ereg_replace &#40;"&#8482;", "&#40;TM&#41;", $row&#91;'products_name'&#93;&#41;;
 	&#125;
	if &#40;$product_manufacturer == 1&#41; &#123;
	$row&#91;'manufacturers_name'&#93;	= ereg_replace &#40;"&", " and ", $row&#91;'manufacturers_name'&#93;&#41;;
  	$row&#91;'manufacturers_name'&#93;	= ereg_replace &#40;"&reg;", "&#40;R&#41;", $row&#91;'manufacturers_name'&#93;&#41;;
  	$row&#91;'manufacturers_name'&#93;	= ereg_replace &#40;"&#8482;", "&#40;TM&#41;", $row&#91;'manufacturers_name'&#93;&#41;;
	&#125;
		$row&#91;'category_container_name'&#93;	= ereg_replace &#40;"<", " a ",$categories_name&#91;'categories_name'&#93;&#41;;

	// build nested product element
	echo "<" . $xml_tags&#91;'product'&#93; ." ITEM='" . $row&#91;'products_id'&#93; . "'>";
 	if &#40;$product_name			== "1"&#41;	&#123; echo	'<' . $xml_tags&#91;'name'&#93; . '>' .  $row&#91;'products_name'&#93;	 . '</' . $xml_tags&#91;'name'&#93; . '>';					&#125; 
	if &#40;$product_price			== "1"&#41;	&#123; echo	'<' . $xml_tags&#91;'price'&#93; . '>' .  $row&#91;'products_price'&#93;	 . '</' . $xml_tags&#91;'price'&#93; . '>';					&#125; 
	if &#40;$product_manufacturer	== "1"&#41;	&#123; echo	'<' . $xml_tags&#91;'manufacturer'&#93; . '>' .  $row&#91;'manufacturers_name'&#93;	 . '</' . $xml_tags&#91;'manufacturer'&#93; . '>';					&#125; 
	if &#40;$product_weight			== "1"&#41;	&#123; echo	'<' . $xml_tags&#91;'weight'&#93; . '>' . $row&#91;'products_weight'&#93; . '</' . $xml_tags&#91;'weight'&#93; . '>';	&#125; 	
	if &#40;$product_model			== "1"&#41;	&#123; echo	'<' . $xml_tags&#91;'model'&#93; . '>' . $row&#91;'products_model'&#93; . '</' . $xml_tags&#91;'model'&#93; . '>'; 	&#125; 			
	if &#40;$product_quantity		== "1"&#41;	&#123; echo	'<' . $xml_tags&#91;'quantity'&#93; . '>' . $row&#91;'products_quantity'&#93; . '</' . $xml_tags&#91;'quantity'&#93; . '>'; 	&#125; 
	if &#40;$product_info_link		== "1"&#41;	&#123; 
		if &#40;$catalog_folder			== ""&#41;	&#123; echo	'<' . $xml_tags&#91;'url'&#93; . '>https&#58;//' . $domain_name . '/product_info.php?products_id=' . $row&#91;'products_id'&#93; . '</' . $xml_tags&#91;'url'&#93; . '>';	&#125; 	
		else								&#123; echo	'<' . $xml_tags&#91;'url'&#93; . '>https&#58;//' . $domain_name . '/' .  $catalog_folder . '/product_info.php?products_id=' . $row&#91;'products_id'&#93; . '</' . $xml_tags&#91;'url'&#93; . '>';	&#125; 	
	&#125; 		 			
	if &#40;$product_image			== "1"&#41;	&#123; 
		if &#40;$catalog_folder			== ""&#41;	&#123; echo	'<' . $xml_tags&#91;'image_url'&#93; . '>https&#58;//' . $domain_name . '/' .  $image_folder . '/' . $row&#91;'products_image'&#93; . '</' . $xml_tags&#91;'image_url'&#93; . '>';	&#125;
		else								&#123; echo	'<' . $xml_tags&#91;'image_url'&#93; . '>https&#58;//' . $domain_name . '/' .  $catalog_folder . '/' .  $image_folder . '/' . $row&#91;'products_image'&#93; . '</' . $xml_tags&#91;'image_url'&#93; . '>';	&#125;
	&#125; 	
	if &#40;$product_date_added		== "1"&#41;	&#123; echo	'<' . $xml_tags&#91;'added'&#93; . '>' . $row&#91;'products_date_added'&#93; . '</' . $xml_tags&#91;'added'&#93; . '>'; &#125; 			
	if &#40;$product_date_modified	== "1"&#41; &#123; echo	'<' . $xml_tags&#91;'modified'&#93; . '>' . $row&#91;'products_last_modified'&#93; . '</' . $xml_tags&#91;'modified'&#93; . '>'; &#125; 			
	if &#40;$product_date_available	== "1"&#41;	&#123; echo	'<' . $xml_tags&#91;'available'&#93; . '>' . $row&#91;'products_date_available'&#93; . '</' . $xml_tags&#91;'available'&#93; . '>'; &#125; 			
	//----------------------------------------------------------------------------------------------
	// START -> insert any extra custom tags here
	//----------------------------------------------------------------------------------------------

	//----------------------------------------------------------------------------------------------
	// END   -> insert any extra custom tags here
	//----------------------------------------------------------------------------------------------
	echo '</' . $xml_tags&#91;'product'&#93; . '>';
&#125;
if &#40;$category_container	== "1"&#41;	&#123; echo '</' . $xml_tags&#91;'category'&#93; . '>'; &#125;
&#125;
&#125;
// free resources and close connection
mysql_free_result&#40;$product_query_result&#41;;
mysql_free_result&#40;$category_query_result&#41;;
mysql_close&#40;$connection&#41;;
if &#40;$show_creation_time == 1&#41; &#123; echo '</' . $xml_tags&#91;'time'&#93; . '>';&#125;
echo '</' . $xml_tags&#91;'master'&#93; . '>';



?>

Άβαταρ μέλους
dva_dev
Script Master
Δημοσιεύσεις: 3790
Εγγραφή: 16 Σεπ 2005 01:32
Επικοινωνία:

πρόβλημα με xml

Δημοσίευση από dva_dev » 05 Νοέμ 2005 14:15

Δεν έχω και πολύ σχέση με php (δεν μπορώ άλλωστε να κάνω αντίστοιχες δοκιμές γιατί δεν την έχω εγκατεστημένη στο μηχάνημα μου) αλλά με μια ματιά που έριξα στον κώδικα θα είχα να προτείνω το εξής:

Σε κάποιο σημείο κάνεις το εξής:
if ($row['parent_id'] > 0 ) {
$parent_category_query = "SELECT `categories_description`.`categories_name`FROM `categories_description`WHERE (`categories_description`.`categories_id` = " . $row['parent_id'] . ")";
$parent_category_query_result = mysql_query($parent_category_query,$connection) or die("Database Query Failed during Parent Category Query.");
$parent = mysql_fetch_array($parent_category_query_result);
$row['categories_name'] = $parent['categories_name'] . ' > ' . $row['categories_name'];
}
Σου σημείωσα με bold την γραμμή που νομίζω ότι εμφανίζεται το πρόβλημα.

Ετσι όπως το υπολογίζω μάλλον στα data του πίνακα σου το πεδίο categories_name έχει (στη 2η γραμμή μάλλον) τιμή "<b>Festina Sports</b>".
Δοκίμασε να βγάλεις από τα data σου το tag "<b>", "</b>" ώστε να γίνει σκέτο "Festina Sports".

Γιατί απ' ότι βλέπω στο xml που δημιουργείς φτιάχνονται οι γραμμές

Κώδικας: Επιλογή όλων

<CATEGORY id='37' name='Festina > Festina Sports'>
...
</CATEGORY>
<CATEGORY id='37' name='Festina > <b>Festina Sports</b>'>
και αυτή η 2η είναι προβληματική.

Ελπίζω να βοήθησα λιγάκι.

Απάντηση

Επιστροφή στο “PHP Προγραμματισμός”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 1 επισκέπτης