Skip to content
Permalink
Browse files
add parse_frag_string() that parses balanced xml
  • Loading branch information
phluid61 committed Nov 8, 2017
1 parent e60cb95 commit 6de50badbe28045a34a41fb8d892080c55b09fb7
Showing with 27 additions and 0 deletions.
  1. +12 −0 perl_lib/EPrints/XML.pm
  2. +15 −0 perl_lib/EPrints/XML/LibXML.pm
@@ -129,6 +129,18 @@ sub parse_string
return parse_xml_string( $string );
}

=item $doc_frag = parse_frag_string( $string )
Parse $string and return it as a new DOM Document Fragment.
=cut

sub parse_frag_string
{
my( $self, $string ) = @_;
return parse_xml_frag_string( $string );
}

=item $doc = $xml->parse_file( $filename, %opts )
Returns an XML document parsed from the file called $filename.
@@ -95,6 +95,21 @@ sub _parse_url
return $doc;
}

=item $doc_frag = parse_xml_frag_string( $string )
Parse $string and return it as a new DOM Document Fragment.
=cut

sub parse_xml_frag_string
{
my( $string ) = @_;

my $frag = $PARSER->parse_balanced_chunk( $string );

return $frag;
}

=item $doc = parse_xml( $filename [, $basepath [, $no_expand]] )
Parse $filename and return it as a new DOM document.

0 comments on commit 6de50ba

Please sign in to comment.