Arg, I'm trying to figure out how to create a album tag based on the last modified date stamp for files which don't have a corresponding .talk file.
IE. 2009 12 10 - Talk Radio.mp3 is how I want them structured, they should all have a corresponding .talk file so my mp3 player can speak the name ie... (0 Replies)
Hi All,
I have a large xml file of invoices. The file looks like below:
<INVOICES>
<INVOICE>
<NAME>Customer A</NAME>
<INVOICE_NO>1234</INVOICE_NO>
</INVOICE>
<INVOICE>
<NAME>Customer A</NAME>
<INVOICE_NO>2345</INVOICE_NO>
</INVOICE>
<INVOICE>
<NAME>Customer A</NAME>... (9 Replies)
Hi unix Gurus,
I am really new to Unix Scripting. Please help me to create a shell script which reads the xml file and from that i need to fetch a particular information.
For example
<SOURCE BUSINESSNAME ="" DATABASETYPE ="Teradata" DBDNAME ="DWPROD3" DESCRIPTION ="" NAME... (2 Replies)
<Start>
<Header>
This is header section
</Header>
<Body>
<Body_start>
This is body section
<a>
<b>
<c>
<st>111</st>
</c>
<d>
<st>blank</st>
</d>
</b>
</a>
</Body_start>
<Body_section>
This is body section (3 Replies)
Hi ,
I have a situation where I need to search an xml file for the presence of a tag
<FollowOnFrom> and also , presence of partial part of the following tag <ContractRequest _LoadId and if these 2 exist ,then
extract the value from the following tag <_LocalId> which is
"CW2094139". There... (2 Replies)
Hi All,
I am having a file like below. The file will having information about the records.If you see the file the file is header and data. For example it have 1 men tag and the tag id will be come after headers. The change is I want to convert All pets tag from P to X. I did a sed like below... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies
LEARN ABOUT DEBIAN
template::plugin::xml::style
Template::Plugin::XML::Style(3pm) User Contributed Perl Documentation Template::Plugin::XML::Style(3pm)NAME
Template::Plugin::XML::Style - Simple XML stylesheet transfomations
SYNOPSIS
[% USE xmlstyle
table = {
attributes = {
border = 0
cellpadding = 4
cellspacing = 1
}
}
%]
[% FILTER xmlstyle %]
<table>
<tr>
<td>Foo</td> <td>Bar</td> <td>Baz</td>
</tr>
</table>
[% END %]
DESCRIPTION
This plugin defines a filter for performing simple stylesheet based transformations of XML text.
Named parameters are used to define those XML elements which require transformation. These may be specified with the USE directive when
the plugin is loaded and/or with the FILTER directive when the plugin is used.
This example shows how the default attributes "border="0"" and "cellpadding="4"" can be added to <table> elements.
[% USE xmlstyle
table = {
attributes = {
border = 0
cellpadding = 4
}
}
%]
[% FILTER xmlstyle %]
<table>
...
</table>
[% END %]
This produces the output:
<table border="0" cellpadding="4">
...
</table>
Parameters specified within the USE directive are applied automatically each time the "xmlstyle" FILTER is used. Additional parameters
passed to the FILTER directive apply for only that block.
[% USE xmlstyle
table = {
attributes = {
border = 0
cellpadding = 4
}
}
%]
[% FILTER xmlstyle
tr = {
attributes = {
valign="top"
}
}
%]
<table>
<tr>
...
</tr>
</table>
[% END %]
Of course, you may prefer to define your stylesheet structures once and simply reference them by name. Passing a hash reference of named
parameters is just the same as specifying the named parameters as far as the Template Toolkit is concerned.
[% style_one = {
table = { ... }
tr = { ... }
}
style_two = {
table = { ... }
td = { ... }
}
style_three = {
th = { ... }
tv = { ... }
}
%]
[% USE xmlstyle style_one %]
[% FILTER xmlstyle style_two %]
# style_one and style_two applied here
[% END %]
[% FILTER xmlstyle style_three %]
# style_one and style_three applied here
[% END %]
Any attributes defined within the source tags will override those specified in the style sheet.
[% USE xmlstyle
div = { attributes = { align = 'left' } }
%]
[% FILTER xmlstyle %]
<div>foo</div>
<div align="right">bar</div>
[% END %]
The output produced is:
<div align="left">foo</div>
<div align="right">bar</div>
The filter can also be used to change the element from one type to another.
[% FILTER xmlstyle
th = {
element = 'td'
attributes = { bgcolor='red' }
}
%]
<tr>
<th>Heading</th>
</tr>
<tr>
<td>Value</td>
</tr>
[% END %]
The output here is as follows. Notice how the end tag "</th>" is changed to "</td>" as well as the start tag.
<tr>
<td bgcolor="red">Heading</td>
</tr>
<tr>
<td>Value</td>
</tr>
You can also define text to be added immediately before or after the start or end tags. For example:
[% FILTER xmlstyle
table = {
pre_start = '<div align="center">'
post_end = '</div>'
}
th = {
element = 'td'
attributes = { bgcolor='red' }
post_start = '<b>'
pre_end = '</b>'
}
%]
<table>
<tr>
<th>Heading</th>
</tr>
<tr>
<td>Value</td>
</tr>
</table>
[% END %]
The output produced is:
<div align="center">
<table>
<tr>
<td bgcolor="red"><b>Heading</b></td>
</tr>
<tr>
<td>Value</td>
</tr>
</table>
</div>
AUTHOR
Andy Wardley
COPYRIGHT
Copyright (C) 2001-2006 Andy Wardley. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Template::Plugin
perl v5.8.8 2008-03-01 Template::Plugin::XML::Style(3pm)