Sponsored Content
Full Discussion: A simpler XML tool
The Lounge What is on Your Mind? A simpler XML tool Post 302567650 by Corona688 on Monday 24th of October 2011 03:34:28 PM
Old 10-24-2011
HTML is a subset of XML with a few weird bits. If you can't parse HTML, you're ignoring most of the XML in the universe. The xgawk documentation claims it's supposed to be nonvalidating for the purpose of parsing less-than-ideal XML...

Building in the extensions statically is a very good idea.
 

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Is there a simpler way to achieve this?

Hi all I have the following which is part of a larger interactive script for adding virtual hosts to Apache's configuration (it was built for non-technical administrators). I'm curious as to whether there is a simpler way of achieving the same thing. All it does is look into the... (3 Replies)
Discussion started by: mlott
3 Replies

2. Programming

How to simplify this perl script to a cleaner simpler look?

my $branch_email_e = $FORM{r_Branch}; my $hostbranch_email_e = $FORM{r_Host_Branch}; my $branch_email_f = $FORM{r_Direction_generale}; my $hostbranch_email_f = $FORM{r_Direction_generale_daccueil}; my $branch_realname_e = ''; my $branch_realname_f = ''; ... (4 Replies)
Discussion started by: callyvan
4 Replies

3. Shell Programming and Scripting

Is there a simpler way to validate user input for float?

I'm trying to only read price (FLOAT (i.e 1.10, 3.14, etc etc)) If the input is just an integer, I will add a .00 behind. (i.e 3 becomes 3.00 , 20 becomes 20.00) If the input is without 2 decimal places, I'll add a 0. (i.e 3.1 becomes 3.10) I tried using the below code, it works but I don't... (6 Replies)
Discussion started by: andylbh
6 Replies

4. Shell Programming and Scripting

A simpler way to do this (save a list of files based on part of their name)

Hello, I have a script that checks every file with a specific extension in a specific directory. The file names contain some numerical output and I am recording the file names with the best n outcomes. The script finds all files in the directory with the extension .out.txt and uses awk to... (12 Replies)
Discussion started by: LMHmedchem
12 Replies

5. UNIX for Dummies Questions & Answers

Simpler next month year program

I have created this program to get the next month and year. Is there a simpler way. #!/bin/ksh string=`cat Date.txt` year=`echo $string | cut -c 1-4` month=`echo $string | cut -c 5-6` echo $year$month mon=`expr $month + 1` if ; then mon=0$mon echo $mon fi if ; then month=01 ... (2 Replies)
Discussion started by: w020637
2 Replies

6. Shell Programming and Scripting

Need simpler way to find all my disk space utilization using df -h

Hi All, I am using SSH Tectia terminal to get the disk space utilization of a particular folder /opt/logs in all the servers one by one using the command df -h and looking through the list of folders manually to get /opt/logs folder disk space used percentage . The problem here is , it... (2 Replies)
Discussion started by: aakhan2011
2 Replies

7. Shell Programming and Scripting

Need simpler version of these commands

Hi all, I am trying to grep a file with the word grand and get all the fields.. Then replace multiple spaces with single space and then get 8 th field and add all these numbers . I am able to do it but with so amny commands which i feel can be done in a simpler way Please let me know if... (4 Replies)
Discussion started by: Hypesslearner
4 Replies

8. Shell Programming and Scripting

Simpler crontab entry to execute pgm on last day of the month

The following bash command line works for the last day of the month. Test by replacing the 1 with tomorrows day of month number && echo "Day before tomorrow"Can it be used within crontab? As * * 28-31 * * && echo "Today ls last day of month" >>/tmp/crontabtestI tried to test crontab with... (1 Reply)
Discussion started by: lsatenstein
1 Replies
XML::TreeBuilder(3)					User Contributed Perl Documentation				       XML::TreeBuilder(3)

NAME
XML::TreeBuilder - Parser that builds a tree of XML::Element objects SYNOPSIS
foreach my $file_name (@ARGV) { my $tree = XML::TreeBuilder->new({ 'NoExpand' => 0, 'ErrorContext' => 0 }); # empty tree $tree->parse_file($file_name); print "Hey, here's a dump of the parse tree of $file_name: "; $tree->dump; # a method we inherit from XML::Element print "And here it is, bizarrely rerendered as XML: ", $tree->as_XML, " "; # Now that we're done with it, we must destroy it. $tree = $tree->delete; } DESCRIPTION
This module uses XML::Parser to make XML document trees constructed of XML::Element objects (and XML::Element is a subclass of HTML::Element adapted for XML). XML::TreeBuilder is meant particularly for people who are used to the HTML::TreeBuilder / HTML::Element interface to document trees, and who don't want to learn some other document interface like XML::Twig or XML::DOM. The way to use this class is to: 1. start a new (empty) XML::TreeBuilder object. 2. set any of the "store" options you want. 3. then parse the document from a source by calling "$x->parsefile(...)" or "$x->parse(...)" (See XML::Parser docs for the options that these two methods take) 4. do whatever you need to do with the syntax tree, presumably involving traversing it looking for some bit of information in it, 5. and finally, when you're done with the tree, call $tree->delete to erase the contents of the tree from memory. This kind of thing usually isn't necessary with most Perl objects, but it's necessary for TreeBuilder objects. See HTML::Element for a more verbose explanation of why this is the case. METHODS AND ATTRIBUTES
XML::TreeBuilder is a subclass of XML::Element, which in turn is a subclass of HTML:Element. You should read and understand the documentation for those two modules. An XML::TreeBuilder object is just a special XML::Element object that allows you to call these additional methods: $root = XML::TreeBuilder->new() Construct a new XML::TreeBuilder object. Parameters: NoExpand Passed to XML::Parser. Do not Expand external entities. Deafult: undef ErrorContext Passed to XML::Parser. Number of context lines to generate on errors. Deafult: undef $root->eof Deletes parser object. $root->parse(...options...) Uses XML::Parser's "parse" method to parse XML from the source(s?) specified by the options. See XML::Parse $root->parsefile(...options...) Uses XML::Parser's "parsefile" method to parse XML from the source(s?) specified by the options. See XML::Parse $root->parse_file(...options...) Simply an alias for "parsefile". $root->store_comments(value) This determines whether TreeBuilder will normally store comments found while parsing content into $root. Currently, this is off by default. $root->store_declarations(value) This determines whether TreeBuilder will normally store markup declarations found while parsing content into $root. Currently, this is off by default. $root->store_pis(value) This determines whether TreeBuilder will normally store processing instructions found while parsing content into $root. Currently, this is off (false) by default. $root->store_cdata(value) This determines whether TreeBuilder will normally store CDATA sectitons found while parsing content into $root. Adds a ~cdata node. Currently, this is off (false) by default. SEE ALSO
XML::Parser, XML::Element, HTML::TreeBuilder, HTML::DOMbo. And for alternate XML document interfaces, XML::DOM and XML::Twig. COPYRIGHT AND DISCLAIMERS
Copyright (c) 2000,2004 Sean M. Burke. All rights reserved. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. This program is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. AUTHOR
Current Author: Jeff Fearn <jfearn@cpan.org>. Former Authors: Sean M. Burke, <sburke@cpan.org> perl v5.16.3 2014-06-09 XML::TreeBuilder(3)
All times are GMT -4. The time now is 05:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy