public function replacePrefixWithUri($prefixedString, $prefixes)
    {
        // check for qname. a qname was given if a : was found, but no < and >
        if (false !== strpos($prefixedString, ':') &&
            false === strpos($prefixedString, '<') && false === strpos($prefixedString, '>')) {
            // prefix is the part before the :
            $prefix = substr($prefixedString, 0, strpos($prefixedString, ':'));

            // if a prefix
            if (true === isset($prefixes[$prefix])) {
                $prefixedString = str_replace($prefix.':', $prefixes[$prefix], $prefixedString);
            }
        }

        return $prefixedString;
    }
public function replacePrefixWithUri($prefixedString, $prefixes)
    {
        // check for qname. a qname was given if a : was found, but no < and >
        if (false !== strpos($prefixedString, ':') &&
            false === strpos($prefixedString, '<') && false === strpos($prefixedString, '>')) {
            // prefix is the part before the :
            $prefix = substr($prefixedString, 0, strpos($prefixedString, ':'));

            // if a prefix
            if (true === isset($prefixes[$prefix])) {
                $prefixedString = str_replace($prefix.':', $prefixes[$prefix], $prefixedString);
            }
        }

        return $prefixedString;
    }
public function replacePrefixWithUri ( $ prefixedString , $ prefixes ) { // check for qname. a qname was given if a : was found, but no < and > if ( false !== strpos ( $ prefixedString , ':' ) && false === strpos ( $ prefixedString , '<' ) && false === strpos ( $ prefixedString , '>' ) ) { // prefix is the part before the : $ prefix = substr ( $ prefixedString , 0 , strpos ( $ prefixedString , ':' ) ) ; // if a prefix if ( true === isset ( $ prefixes [ $ prefix ] ) ) { $ prefixedString = str_replace ( $ prefix . ':' , $ prefixes [ $ prefix ] , $ prefixedString ) ; } } return $ prefixedString ; }
Replaces the prefix in a string with the original URI.

@param string $prefixedString string to adapt
@param array  $prefixes       array containing prefixes as keys and according URI as value

@return string
Replaces the prefix in a string with the original URI .