diff options
author | hansp <hansp> | 2001-07-06 21:38:56 +0000 |
---|---|---|
committer | hansp <hansp> | 2001-07-06 21:38:56 +0000 |
commit | 78646652f18a3551e8b320b3fc8d7fa548bf04fb (patch) | |
tree | 158696d0576ea031b526fb5f197f8a44976921e1 | |
parent | 10dae45c3613d0b09fac612edf8b51d7c3f3e645 (diff) |
2001-07-06 Hans Petter Jansson <hpj@ximian.com>
* parse.pl.in (xst_parse_xml): Begin XML config parser.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | parse.pl.in | 18 | ||||
-rwxr-xr-x | rhprinterdb2xstxml.pl | 1 | ||||
-rwxr-xr-x | test.pl | 66 |
4 files changed, 24 insertions, 65 deletions
@@ -1,3 +1,7 @@ +2001-07-06 Hans Petter Jansson <hpj@ximian.com> + + * parse.pl.in (xst_parse_xml): Begin XML config parser. + 2001-07-06 Arturo Espinosa Aldama <arturo@ximian.com> * network.pl.in (xst_network_address_lookup_call): A diff --git a/parse.pl.in b/parse.pl.in index 0cbf8f6..008c02b 100644 --- a/parse.pl.in +++ b/parse.pl.in @@ -1293,3 +1293,21 @@ sub xst_parse_pump_get_iface_kw_not return 0 if &xst_parse_pump_get_iface_option_ref ($file, $iface, $key) != -1; return 1; } + +# Read a variable out of an XML document. The varpath is the dot-separated path to the +# XML tag. If the name of a property is passed, that property of the leaf tag is read, +# otherwise the tag's PCDATA. +sub xst_parse_xml +{ + my ($file, $varpath, $property) = @_; + my ($tree, @path); + + $tree = &xst_xml_scan ($file); + @path = split /./, $varpath; + + for $elem (@path) + { + + } + +} diff --git a/rhprinterdb2xstxml.pl b/rhprinterdb2xstxml.pl index 57fed6f..be456a6 100755 --- a/rhprinterdb2xstxml.pl +++ b/rhprinterdb2xstxml.pl @@ -28,7 +28,6 @@ sub xml_quote my $joined = 0; my @xml_entities = ( "<", '<', ">", '>', "'", '\'', """, '"', "&", '&' ); - my @clist = split (//, $in); while (@clist) @@ -95,68 +95,6 @@ sub test_interfaces # --- -$hash = &xst_print_conf_get (); -delete $$hash {'lp'}; -print $$hash{'lp0'}{'sd'} . "\n"; -# $$hash {'lp0'}->{'spooldir'} = "/var/pekk"; -# $$hash {'lp0'}->{'device'} = "pekk-port"; -$$hash {'lp0'}->{'suppress_headers'} = 0; -&xst_print_conf_set ($hash); - -&xst_debug_print_struct ($hash); - -# &xst_replace_remove_cap_section ("/etc/printcap", "lp"); - -# &xst_replace_printcap ("/etc/printcap", "lp", "lpekk", "#", "100"); -# &xst_replace_printcap ("/etc/printcap", "newlp", "loff", "", 1); -# &xst_replace_printcap_remove_printer ("/etc/printcap", "lp"); - -# $buf = &xst_replace_load_printcap_buffer ("/etc/printcap"); -# -# for $i (@$buf) -# { -# print $i; -# } - - - -# @arr = &xst_parse_cap_sections ("/etc/termcap"); - -# for $i (@arr) -# { -# my $tc = &xst_parse_cap ("/etc/termcap", $i, "tc"); -# my $am = &xst_parse_cap_bool ("/etc/termcap", $i, "am"); -# print "$i\t\t($tc)"; -# print " (am)" if ($am == 1); -# print "\n"; -# } - -# $arr = &xst_filesys_parse_fstab ("/etc/fstab"); -# $arr = &xst_filesys_parse_mtab ("/etc/mtab"); - -# print @arr[0] . "\n"; - -# &xst_filesys_table_remove ($arr, &xst_filesys_table_find ($arr, "point", "/")); -# &xst_filesys_table_remove ($arr, &xst_filesys_table_find ($arr, "point", "/mnt/floppy")); -# &xst_debug_print_struct ($arr); - -# $table = &xst_share_parse_smb_conf ("/etc/samba/smb.conf"); -# &xst_share_replace_smb_conf ("/etc/samba/smb.conf.test", $table); - -# &test_interfaces(); -# &test_media(); - -# be_service_enable(90, "-d pekk", "samba", "smbd", "smb", "httpd"); -# be_service_disable(15, "-d pekk", "samba", "smbd", "smb", "httpd"); - -# be_run("ls /etc"); -# be_run("ls /etc"); -# be_run("ls /etc"); -# be_run("ls /etc"); -# be_run("grokk pekk fette"); -# be_run("grokk pekk fette"); -# be_run("grokk pekk fette"); - -# be_locate_tool("pekk"); -# be_locate_tool("pekk"); +$tree = &xst_xml_scan ("/etc/alchemist/namespace/printconf/local.adl"); +&xst_debug_print_struct ($tree); |