01-09-2012
Thanks ahamed, that is exactly what I was looking for.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I am looking for a awk/shell which can find an element named REFERENCE in a XML file and check whether it is empty or not.
If there is no value in the REFERENCE element then correspondingly move the file to some other folder.
The Unix server is AIX version 4.
Any inputs... (9 Replies)
Discussion started by: karansachdeva
9 Replies
2. Shell Programming and Scripting
Hi,
I have defined an array which holds a couple of elements which are nothing but files names. I want to find the files in a directory for the matching file name(array elements) with less than 1 day old.
When I am trying to execute the code (as below), it gives an error.
Your help in this... (1 Reply)
Discussion started by: mkbaral
1 Replies
3. Shell Programming and Scripting
Hi All
Can someone please help me with this awk to search an element in a XML file with a particular value and then change the root element.
Thanks & Regards
Karan (9 Replies)
Discussion started by: karansachdeva
9 Replies
4. Shell Programming and Scripting
I have a rather large file with XML-style content. Each line contains one full XML entry. For example:
1:<Message><DNIS>1234</DNIS><UCID>3456</UCID><TransferGroup>XYZXYZ</TransferGroup></Message>
2:<Message><DNIS>9999</DNIS><UCID>2584</UCID><TransferGroup>ABCABC</TransferGroup></Message>... (1 Reply)
Discussion started by: sharpi03
1 Replies
5. UNIX Desktop Questions & Answers
Hi, I would need to read an xml element from an xml file to a local variable. Please could you help me with a shell script to get so? Considering that I have a file called file.xml like below:
<header>
<description>This is the description</description>
<content>This is the... (2 Replies)
Discussion started by: oscarmon
2 Replies
6. Shell Programming and Scripting
Any help to extract the root element from an XML file will be appreciated.
Example: test.xml
<?xml version="1.0" encoding="utf-8" ?>
<TestXMLMessage>
<TestRec>
<ID>1000</ID>
</TestRec>
</TestXMLMessage>
Wanted to extract the TestXMLMessage.
Regards,
Chari (6 Replies)
Discussion started by: sree_chari
6 Replies
7. Shell Programming and Scripting
Given this XML:
<?xml version="1.0"?>
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
... (2 Replies)
Discussion started by: ricksj
2 Replies
8. UNIX for Advanced & Expert Users
Hi,
I'm trying to write a script for some xml file handling, but I'm not getting too far with it.
I've got the following xml content
<?xml version="1.0" encoding="UTF-8"?>
<Test xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<Operation name="OPER1">
<Action name="ACTION1">... (2 Replies)
Discussion started by: Juha
2 Replies
9. Shell Programming and Scripting
Hi All
I have a problem that I am not able to resolve.
Briefly, I have a file like this:
ID_1 10
ID_2 15
ID_3 32
ID_4 45
ID_5 66
ID_6 79
ID_7 88This file is numerically ordered for the 2th column.
And another file containing a list of IDs(just one in this example)
ID_4What I... (7 Replies)
Discussion started by: giuliangiuseppe
7 Replies
10. UNIX for Dummies Questions & Answers
<?xml version = '1.0' encoding =... (8 Replies)
Discussion started by: Siva SQL
8 Replies
LEARN ABOUT DEBIAN
xml::smart::dtd
XML::Smart::DTD(3pm) User Contributed Perl Documentation XML::Smart::DTD(3pm)
NAME
XML::Smart::DTD - DTD parser for XML::Smart.
DESCRIPTION
This will parse DTD and provides methods to access the information stored in the DTD.
USAGE
use XML::Smart::DTD ;
my $dtd = XML::Smart::DTD->new('some.dtd') ;
if ( $dtd->child_exists('tag1','subtag1') ) {
...
}
use Data::Dumper ;
print Dumper( $dtd->tree ) ;
new
METHODS
attr_exists ( TAG , ATTR )
Return TRUE if the attribute exists in the element TAG.
child_exists ( TAG , CHILD )
Return TRUE if the child exists in the element TAG.
elem_exists ( TAG )
Return TRUE if the element TAG exists.
error
Return the error list.
get_attr_def ( TAG , ATTR )
Return the default value of an attribute
get_attr_type ( TAG , ATTR )
Return the attribute type.
get_attr_values ( TAG , ATTR )
Return the defined values of an attribute.
get_attrs ( TAG )
Return the attribute list of a element.
get_attrs_req ( TAG )
Return the required attribute list of a element.
get_childs ( TAG )
Return the child list of an element.
get_childs_req ( TAG )
Return the required child list of an element.
get_elem_opt ( TAG )
Return the occurrence option of an element:
! REQUIRED AND ONLY ONE MATCH
+ 1 or more
* 0 or more
? 0 or 1
get_elem_child_opt ( TAG , CHILD )
Same of get_elem_opt() but this element as a child of an element.
is_attr_fix ( TAG , ATTR )
Return TRUE if an attribute is FIXED.
is_attr_req ( TAG , ATTR )
Return TRUE if an attribute is REQUIRED.
is_elem_any ( TAG )
Return TRUE if an element is ANY.
is_elem_child_multi ( TAG , CHILD )
Return TRUE if an element can have multiple occurrences as a child of TAG.
is_elem_child_opt ( TAG , CHILD )
Return TRUE if an element is optional as a child of TAG.
is_elem_child_req ( TAG , CHILD )
Return TRUE if an element is optional as a child of TAG.
is_elem_child_uniq ( TAG , CHILD )
Return TRUE if an element is required and unique as a child of TAG.
is_elem_pcdata ( TAG )
Return TRUE if an element is PCDATA (have content).
is_elem_empty ( TAG )
Return TRUE if an element is EMPTY (doesn't have attributes, content or children).
is_elem_multi ( TAG )
Return TRUE if an element can have multiple occurrences globally.
is_elem_opt ( TAG )
Return TRUE if an element is optional globally.
is_elem_parent ( TAG , @PARENTS )
Return TRUE if the list of @PARENTS can be parent of element TAG.
is_elem_req
Return TRUE if an element is required globally.
is_elem_uniq
Return TRUE if an element is unique and required globally.
root
Return the root name of the DTD.
tree
Return the HASH tree of the DTD.
SEE ALSO
XML::Smart, XML::DTDParser.
AUTHOR
Graciliano M. P. <gm@virtuasites.com.br>
I will appreciate any type of feedback (include your opinions and/or suggestions). ;-P
THANKS
Thanks to Jenda@Krynicky.cz http://Jenda.Krynicky.cz that is the author of XML::DTDParser.
COPYRIGHT
The DTD parser was based on XML-DTDParser-1.7 by Jenda@Krynicky.cz http://Jenda.Krynicky.cz
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2004-09-01 XML::Smart::DTD(3pm)