startElement

XML callback function for the start of a new XML tag.

Description

startElement( (mixed) $parser, (string) $tagName, (array) $attrs ); 

Parameters (3)

0. $parser (mixed)
XML Parser resource.
1. $tagname (string)
XML element name.
2. $attrs (array)
XML element attributes.

Usage

  1. if ( !function_exists( 'startElement' ) ) { 
  2. require_once ABSPATH . '/wp-admin/link-parse-opml.php'; 
  3.  
  4. // XML Parser resource. 
  5. $parser = null; 
  6.  
  7. // XML element name. 
  8. $tagname = ''; 
  9.  
  10. // XML element attributes. 
  11. $attrs = array(); 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = startElement($parser, $tagname, $attrs); 
  15.  

Defined (1)

The function is defined in the following location(s).

/wp-admin/link-parse-opml.php  
  1. function startElement($parser, $tagName, $attrs) { 
  2. global $names, $urls, $targets, $descriptions, $feeds; 
  3.  
  4. if ( 'OUTLINE' === $tagName ) { 
  5. $name = ''; 
  6. if ( isset( $attrs['TEXT'] ) ) { 
  7. $name = $attrs['TEXT']; 
  8. if ( isset( $attrs['TITLE'] ) ) { 
  9. $name = $attrs['TITLE']; 
  10. $url = ''; 
  11. if ( isset( $attrs['URL'] ) ) { 
  12. $url = $attrs['URL']; 
  13. if ( isset( $attrs['HTMLURL'] ) ) { 
  14. $url = $attrs['HTMLURL']; 
  15.  
  16. // Save the data away. 
  17. $names[] = $name; 
  18. $urls[] = $url; 
  19. $targets[] = isset( $attrs['TARGET'] ) ? $attrs['TARGET'] : ''; 
  20. $feeds[] = isset( $attrs['XMLURL'] ) ? $attrs['XMLURL'] : ''; 
  21. $descriptions[] = isset( $attrs['DESCRIPTION'] ) ? $attrs['DESCRIPTION'] : ''; 
  22. } // End if outline.