<%@  page pageEncoding="utf-8" contentType="text/html;charset=utf-8" import="com.novell.webaccess.common.JSPConduit, com.novell.emframe.dev.eMFrameUtils" %>
<%   JSPConduit c = JSPConduit.getJSPConduit(request); %>
<%--

   XmlScripts.inc
      -Light weight cross browser dom for parsing and construting XML
      -On IE 5+ and PocketPC uses Microsoft ActiveX Xml Parser for increased performance
      -On all other platforms uses our own Javascript parser
      -Supports IE5+ NN6+ and PocketPC


   Global methods
      XmlElement parseXml(xmlStr)                  Used for parsing xml

      getValueFromXml(str)                         For getting value from simple xml "<attribute><value>text</value></attribute>"; used most often with EDAS
      toXmlString(value, mode)                     For building simple xml "<attribute><value>text</value></attribute>"; used with EDAS
      xmlEncode(s)                                 If you aren't using XmlElement for parsing and constructing xml, use these to encode each tag and text
      xmlDecode(s)


   Class XmlElement
      Constructors:
         XmlElement()
         XmlElement(tagName)                       => represents "<tagName></tagName>"
         XmlElement(tagName, text)                 => represents "<tagName>text</tagName>
      Methods:
         void add(XmlElement)                      Adds XmlElement to end of children list
         void clearChildren()                      Removes all childre
         String toString()                         Returns the xml string represented by this XmlElement
         String getName()                          return the tagName
         String getText()                          returns the text
         String getChildTextTrim(tagName)          returns the text if the first child with the specified tagName
         XmlElement[] getChildren()                returns all the children of this node
         XmlElement[] getChildren(tagName)         returns all the children of this node with the specified tagName
         String getAttributeValue(key)             returns value for corresponding key
         void setAttribute(key,value)              sets value for key


   Methods used by EDAS/TemplateBuilder widgets
      String getWidgetValueAsXml(textbox)
      void initWidgetFromXml(textbox, xmlString)
      void initMooMode(controlName, xmlString)

   Encoding issues:
      <root>Hello<World.novell</root>     is invalid xml because of the less than than sign
      <root>Hello&lt;World.novell</root>  is valid xml


   Example Parse XML:
      var root = parseXml("<Facsimile_Telephone_Number ><value><bits>0</bits><telephone-number>444-4444</telephone-number></value></Facsimile_Telephone_Number>");
      var children = root.getChildren();
      if ((children != null) && (children.length > 0))
      {
         form._Facsimile_Telephone_Number.value = children[0].getChildTextTrim("telephone-number");
      }

   Example Builder XML:
      var val = new XmlElement('value');
      val.add(new XmlElement('bits','0'));
      val.add(new XmlElement('telephone-number',form._Facsimile_Telephone_Number.value));
      var xml = new XmlElement('attribute');
      xml.add(val);
      form.eDir$target$Facsimile_Telephone_Number.value=xml.toString();

--%>

<SCRIPT language="JavaScript" src="<%= c.getModulesUrl()%>/dev/javascripts/XmlElement.js"></SCRIPT>
<%--<SCRIPT language="JavaScript" src="<%= c.getModulesUrl()%>/dev/javascripts/XmlParser.js"></SCRIPT>--%>
<%--<SCRIPT language="JavaScript" src="<%= c.getModulesUrl()%>/dev/javascripts/XmlParserIE.js"></SCRIPT>--%>
