And I ran your xml through xmltidy. It's still not valid, but works for this test:#!/usr/bin/perl use strict; use warnings; use XML::LibXML; my @files = '/root/Desktop/your.xml'; my $parser = XML::LibXML->new(); foreach my $file( @files) { my $doc = $parser->parse_file($file); my $cmm_root_path_var = $doc->findnodes("//Test/*"); print $doc->to_literal(), "\n"; }
<?xml version="1.0" encoding="utf-8"?> <build> <name>lpass</name> <build_id>M8960AAAAANAAL1004</build_id> <windows_root_path cmm_root_path_var="PASS_BUILD_ROOT">\\TEST\M965 +0AAAAANAAL1004\</windows_root_path> <linux_root_path cmm_root_path_var="PASS_BUILD_ROOT" /> <image_dir>lpass_proc</image_dir> <name>rpm</name> <build_id>M8960AAAAANAAR1004</build_id> <windows_root_path cmm_root_path_var="PM_BUILD_ROOT">\\TEST\M9650AAA +AANAAR1004\</windows_root_path> <linux_root_path cmm_root_path_var="PM_BUILD_ROOT" /> <image_dir>rpm_proc</image_dir> <download_file> <file_name>rpm.mbn</file_name> <file_path>rpm_proc/</file_path> </download_file> <name>wcnss</name> <build_id>M8960AAAAANAAW1004</build_id> <windows_root_path cmm_root_path_var="NSS_BUILD_ROOT">\\TEST\M9650AA +AAANAAW1004\</windows_root_path> <linux_root_path cmm_root_path_var="NSS_BUILD_ROOT" /> <image_dir>wcnss_proc</image_dir> </build>
In reply to Re: Parsing an xml file
by Khen1950fx
in thread Parsing an xml file
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |