Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

xml::parser::style::tree(3pm) [debian man page]

Parser::Style::Tree(3pm)				User Contributed Perl Documentation				  Parser::Style::Tree(3pm)

NAME
XML::Parser::Style::Tree - Tree style parser SYNOPSIS
use XML::Parser; my $p = XML::Parser->new(Style => 'Tree'); my $tree = $p->parsefile('foo.xml'); DESCRIPTION
This module implements XML::Parser's Tree style parser. When parsing a document, "parse()" will return a parse tree for the document. Each node in the tree takes the form of a tag, content pair. Text nodes are represented with a pseudo-tag of "0" and the string that is their content. For elements, the content is an array reference. The first item in the array is a (possibly empty) hash reference containing attributes. The remainder of the array is a sequence of tag- content pairs representing the content of the element. So for example the result of parsing: <foo><head id="a">Hello <em>there</em></head><bar>Howdy<ref/></bar>do</foo> would be: Tag Content ================================================================== [foo, [{}, head, [{id => "a"}, 0, "Hello ", em, [{}, 0, "there"]], bar, [ {}, 0, "Howdy", ref, [{}]], 0, "do" ] ] The root document "foo", has 3 children: a "head" element, a "bar" element and the text "do". After the empty attribute hash, these are represented in it's contents by 3 tag-content pairs. perl v5.14.2 2011-11-15 Parser::Style::Tree(3pm)

Check Out this Related Man Page

Parser::Style::Tree(3)					User Contributed Perl Documentation				    Parser::Style::Tree(3)

NAME
XML::Parser::Style::Tree SYNOPSIS
use XML::Parser; my $p = XML::Parser->new(Style => 'Tree'); my $tree = $p->parsefile('foo.xml'); DESCRIPTION
This module implements XML::Parser's Tree style parser. When parsing a document, "parse()" will return a parse tree for the document. Each node in the tree takes the form of a tag, content pair. Text nodes are represented with a pseudo-tag of "0" and the string that is their content. For elements, the content is an array reference. The first item in the array is a (possibly empty) hash reference containing attributes. The remainder of the array is a sequence of tag- content pairs representing the content of the element. So for example the result of parsing: <foo><head id="a">Hello <em>there</em></head><bar>Howdy<ref/></bar>do</foo> would be: Tag Content ================================================================== [foo, [{}, head, [{id => "a"}, 0, "Hello ", em, [{}, 0, "there"]], bar, [ {}, 0, "Howdy", ref, [{}]], 0, "do" ] ] The root document "foo", has 3 children: a "head" element, a "bar" element and the text "do". After the empty attribute hash, these are represented in it's contents by 3 tag-content pairs. perl v5.18.2 2011-05-24 Parser::Style::Tree(3)
Man Page

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Help rearrange the content of the file.

Hi all, I need to rearrange the content of the file. I need to move line 1 to 4, 2 to 3, 3 to 2, and 4 to 1. IPlease help. I was thinking about using head and tail command. Here is the original file. aa bb cc dd Here is what I need it to be. dd cc bb aa Thanks. (6 Replies)
Discussion started by: sirrtuan
6 Replies

2. Shell Programming and Scripting

Truncate the content within alt attribute to first 250 characters.

I have a xml file which contains image tag as follows: <image><img src="wstc_0007_0007_0_img0001.jpg" width="351" height="450" alt="This is the cover page. Brazil &#x2022; Japan &#x2022; Korea &#x2022; Mexico &#x2022; Singapore &#x2022; Spain" type="photograph" orient="portrait"/></image> ... (5 Replies)
Discussion started by: parshant_bvcoe
5 Replies

3. Shell Programming and Scripting

appending content in a xml file

Please help me on this..... i have a file which has following content: <IPCoreProducerConfig> <Producer> <config> <key>machineId</key> <value>machine1</value> </config> <config> ... (4 Replies)
Discussion started by: Aditya.Gurgaon
4 Replies

4. UNIX for Dummies Questions & Answers

Directory Help

I am new to UNIX, and am designing a hierarchical Tree I am using mkdir -p "filename" to create the main file, what do I use to create the subfolders and make a .txt document in the subfolders. Then after that is done i need to do it over again. How should this look. Am I doing it right? Thanks... (1 Reply)
Discussion started by: skweekslv
1 Replies

5. HP-UX

XML tag name content replacement

Hi, Need to replace an XML tag name contents, please provide any suggestions. Scenario is : <abc_def>Value_some_content</abc_def> Expected output : <abc:def>Value_some_content</abc:def> We have many tag with different names & contents in a file or a string. Please help on the... (3 Replies)
Discussion started by: periyasamycse
3 Replies

6. Shell Programming and Scripting

How to check empty string in an XML tag?

I have an XML tag <abc> which is empty as <abc></abc>.If the the tag is empty I want to flag the file as bad. Please help. Thanks (3 Replies)
Discussion started by: aneeta13
3 Replies

7. Answers to Frequently Asked Questions

Why Parsing Can't be Done With sed ( or similar tools)

Regularly we have questions like: i have an XML (C, C++, ...) file with this or that property and i want to extract the content of this or that tag (function, ...). How do i do it in sed? Yes, in some (very limited) cases this is possible, but in general this can't be done. That is: you can do... (0 Replies)
Discussion started by: bakunin
0 Replies

8. Shell Programming and Scripting

Moving XML tag/contents after specific XML tag within same file

Hi Forum. I have an XML file with the following requirement to move the <AdditionalAccountHolders> tag and its content right after the <accountHolderName> tag within the same file but I'm not sure how to accomplish this through a Unix script. Any feedback will be greatly appreciated. ... (19 Replies)
Discussion started by: pchang
19 Replies