zk.xml
Class Utl

java.lang.Object
  extended by zk.xml.Utl

public class Utl
extends java.lang.Object

Utilities for parsing XML and others.

Refer to zUtl for basic utilities.


Method Summary
static String getElementValue(DOMElement el)
          Returns the concatenation of the text nodes under the specified DOM element.
static DOMElement loadXML(String url, Function callback)
          Loads XML from the resource at the specified URL.
static DOMElement parseXML(String text)
          Parses and returns the XML document from the specified text.
static String renType(String url, String type)
          Renames the type embedded in an URL For example, zk.xml.Utl.renType("/zkdemo/img/whatever-off.gif", "on"); //return "/zkdemo/img/whatever-on.gif" as shown above, it assumes the type is embedded after dash (-).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

loadXML

public static DOMElement loadXML(String url,
                                 Function callback)
Loads XML from the resource at the specified URL. If the callback method is specified, the URL is loaded asynchronously and the callback is called with the XML document after the document is loaded and parsed.

Parameters:
url -
callback -
Returns:
DOMElement

parseXML

public static DOMElement parseXML(String text)
Parses and returns the XML document from the specified text.

Parameters:
text -
Returns:
DOMElement

renType

public static String renType(String url,
                             String type)
Renames the type embedded in an URL For example,

zk.xml.Utl.renType("/zkdemo/img/whatever-off.gif", "on");
        //return "/zkdemo/img/whatever-on.gif"
as shown above, it assumes the type is embedded after dash (-).

Parameters:
url - the URL to modify
type - the type to replace with
Returns:
String the new URL after replacing the type

getElementValue

public static String getElementValue(DOMElement el)
Returns the concatenation of the text nodes under the specified DOM element.

Parameters:
el - the DOM element.
Returns:
String the text


Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo