Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.sapia.util.xml;

This class contains some utility methods use by the Sapia XML tools.

Jean-Cedric Desrochers
Copyright &.169; 2002-2003 Sapia Open Source Software. All Rights Reserved.
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site
public class XmlUtil {
Defines the ":" delimiter that separates local name and prefix
  private static final char PREFIX_SEPARATOR = ':';

Extract the namespace prefix from the qualified element name passed in. If the the qualified name passed in is null, it returns null.

aQualifiedName The qualified name from which to extract the prefix.
The extracted prefix or null if the qualified name is null;
  public static String extractPrefix(String aQualifiedName) {
    String aPrefix = null;
    if (aQualifiedName != null) {
      int anIndex = aQualifiedName.indexOf();
      if (anIndex > -1) {
        aPrefix = aQualifiedName.substring(0, anIndex);
    return aPrefix;
New to GrepCode? Check out our FAQ X