xml::parser::style::tree(3) [opensolaris 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.8.4 2003-08-18 Parser::Style::Tree(3)
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.12.1 2003-07-31 Parser::Style::Tree(3)
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)
Dear all ,
I have a file whose content has the following format:
jboss.web:type=ThreadPool,name=AAAA
jboss.web:type=ThreadPool,name=BBBB
How can I parse this file to get the value of the name of each line (AAAA , BBBB) and store the result to an array ? (array = AAAA , array = BBBB).... (4 Replies)
Hi,
Need a script to parse the following xml file content
<tag1 Name="val1">
<abc Name="key"/>
<abc Name="pass">*********</abc>
</tag1>
<tag2 Name="Core">
<Host Name="a.b.c">
<tag1 Name="abc">
<abc Name="ac">None</abc>
... (4 Replies)
How the below ex.txt file can be parsed using starting bracket'(' and ending bracket')' and hav to store the values without quotes in a text file.
There will be some 10 or 20 lines inbetween starting brakcet and ending bracket at first there may be 5 words,2ndl ine only 1 word, third line 6... (3 Replies)
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 • Japan • Korea • Mexico • Singapore • Spain" type="photograph" orient="portrait"/></image>
... (5 Replies)
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)
Hello everybody, I'm new in this forum.
I searched a long time for a solution for my problem but I didn't find the right thing.
I have to read from a file (content is "abngjm" without any other signs) and have to write this content in an array. But every sign has to be called by its own... (5 Replies)
i have an xml tag. The value for the tag should be iterated through out the xml document.
eg:
<data><id><id><name>a</name><addr>aaa</addr><phnumb>3456</phnumb><state>ca</state><city>ny</city></data>... (6 Replies)
hi all,
i have some file whoes contents are
0 /home8/mc09ats/UnixCw/a1
1 /home8/mc09ats/UnixCw/a2
2 /home8/mc09ats/b3
3 /home8/mc09ats/UnixCw/d1
i want to seperate the content following way...
fileindex= 0
filepath=... (4 Replies)
Hi:
I'm trying to write a script that reformats a given document (edit the content of a given document) , I want to add a new line \n after each ; in the document.
Regards (6 Replies)
I have an XML tag like this:
<property name="agent" value="/var/tmp/root/eclipse" />
Is there way using awk that i can get the value from the above tag. So the output should be:
/var/tmp/root/eclipse
Help will be appreciated.
Regards,
Adi (6 Replies)
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)