Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Matteo on Sep 09, 2008 10:47
open dhtmlx forum
dhtmlxMenu problem characters special in XML MenuItem href

Hello, I have a problem with dhtmlxMenu.
an error appears to execute of the page:
"Error type: LoadXml
Description: Incorrect XML"

my XML:
<?xml version='1.0' ?>
<menu name="amministrazione flash" withoutImages="yes">
    <MenuItem name="AMBIENTE APPLICATIVO" width="120px" panelWidth="130px" withoutImages="yes">
            <MenuItem name="Sigle " width="50px" panelWidth="130px">
             <MenuItem name="Computed Value" id="main_b1" href="TESSWV?OpenView&count=1000" target="_self"/>
            </MenuItem>
    </MenuItem>
</menu>

my page:
...
<script language="JavaScript" src="codebase/dhtmlxprotobar.js"></script>
<script language="JavaScript" src="codebase/dhtmlxmenubar.js"></script>
<script language="JavaScript" src="codebase/dhtmlxmenubar_cp.js"></script>
<script language="JavaScript" src="codebase/dhtmlxcommon.js"></script>
</head>
<body>
<div id="menu_zone" style="width:600; height:50;"/>
</body>
<script type="text/javascript">
aMenuBar=new dhtmlXMenuBarObject("menu_zone","100%","30","Demo",0,"images/","empty.html");
aMenuBar.disableSmartPositioning(true);
aMenuBar.loadXML("source_xml/2_menu.xml");
aMenuBar.showBar();
</script>


I have understanding that it depends from the characters special in XML MenuItem href: href="TESSWVOpen&Viewcount1000"
(? end &)

You can help me?
hello, thanks matteo

Answer posted by Support on Sep 10, 2008 01:36
The XML doesn't allow direct usage of < > & characters, they need to be replaced with &lt; &gt; &amp;

  <MenuItem name="Computed Value" id="main_b1" href="TESSWV?OpenView&amp;count=1000" target="_self"/>

When processed by javascript code &amp; will be converted back to & automatically.