Board Logo

DB Access with build_hierarchy problem
schwarzer11 - 3/13/2008 at 04:27 PM

Hi,

when I inserted:
<script language="JavaScript">
<?build_hierarchy_var('localhost:8501', 'root', '', 'First_PDM', 'tx_pdmtest_hparts_parent_mm', 'TREE_ITEMS', 'uid_local', 'uid_foreign', 'uid_local', '');?>
</script>
into my Header i got the following error message:
"invalid XML markup". How can this be? I tried with a static TREE_ITEMS file and everything works just perfekt. Also the DB Access for itself works just fine, just the Line inserted into the header seems to mess things up.
Does anyone have an idea what i'm doing wrong??

Thanx in advance
Marco


tigra - 3/14/2008 at 02:53 PM

There is no XML involved in the generating of the tree items. The error message probably refers to the HTML of the page which is sort of XML. Look at the source of the page and google the error message together with the name of the server side system you're using.


schwarzer11 - 3/14/2008 at 05:18 PM

I'm using TYPO3 and there is no Problem on this end. The page looks like this:

<!DOCTYPE html
PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<!--
This website is powered by TYPO3 - inspiring people to share!
-->

<link rel="stylesheet" type="text/css" href="fileadmin/styles/my_style.css" />
<script type="text/javascript" src="fileadmin/tmenu/tree.js" language="JavaScript"></script>
<script type="text/javascript" src="fileadmin/tmenu/tree_tpl.js" language="JavaScript"></script>
<script language="JavaScript"><?build_hierarchy_var('localhost:8501', 'root', '', 'First_PDM', 'tx_pdmtest_hparts_parent_mm', 'TREE_ITEMS', 'uid_local', 'uid_foreign', 'tablenames', 'sorting');?></script>

<title>FTS 2</title>

<meta name="generator" content="TYPO3 4.1 CMS" />
<script type="text/javascript" src="typo3temp/javascript_757c080409.js"></script>


</head>
<body>
....

<div><script language="JavaScript">

new tree (TREE_ITEMS, TREE_TPL);

</script></div>

I still get the error message about the "invalid XML markup" in line: <?build_hierarchy_var('localhost:8501', 'root', '', 'First_PDM', 'tx_pdmtest_hparts_parent_mm', 'TREE_ITEMS', 'uid_local', 'uid_foreign', 'tablenames', 'sorting');?>

and therefore the next error, that "TREE_ITEMS is not defined" (because it wasn't created by build_hierarchy).
How does this work anyways. How does the "build_hierarchy" funciton pass on the TREE_ITEMS variable. in static mode it gets the items from the file, but now...?

Thanks for any help
Marco


tigra - 4/14/2008 at 03:30 PM

is this all inside the php file?

try replacing <? build_hierarchy_var( ... ?>
with say <? echo "/* test */" ?>

you'll surely get client side "TREE_ITEMS is not defined" error, but there should be no errors regarding XML
If you still get one then it means that the code is not being handled as php (it's probably fed to some CMS as template). You'll have to talk to CMS people to find out how to use custom php code there.


Softcomplex: http://www.softcomplex.com/
Back to forum: http://www.softcomplex.com/forum/