10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello,
I have in my backup folder, files with names convention like this :
randomFileNames_13-02-2014_23h13m09+1392333189
randomFileNames_14-02-2014_02h13m09+1392343989
randomFileNames_14-02-2014_04h13m09+1392351189
etc....
Base on timestamp at end of the filename, I would to delete all the... (7 Replies)
Discussion started by: thuyetti
7 Replies
2. UNIX for Dummies Questions & Answers
Hi
I have a file:
r58778.3|SOURCES={KEY=f665931a...,fw,221-705}|ERRORS={16_1:T,30_1:T,56_1:C,57_1:T,59_1:A,101_1:A,115:-,158_1:C,186_1:A,204:-,271_1:T,305:-,350_1:C,368_1:G,442_1:C,472_1:G,477_1:A}|SOURCE_1="Contig_1092402550638"(f665931a359e36cea0976db191ff60ff09cc816e)
I want to retain... (15 Replies)
Discussion started by: Alyaa
15 Replies
3. UNIX for Advanced & Expert Users
Hi,
I have a query:
I have a bunch of files starting letter with 'a'
(example: abhi,all,anand,animal,a1.txt,allow.java,a*)
here i want to delete/remove only a* folder but not other files and folders. and a* folder is present in so many other folders.
what is unix command to delete... (9 Replies)
Discussion started by: rajanikanth86
9 Replies
4. Shell Programming and Scripting
Hello ,
I have comma delimited file with over 20 fileds that i need to do some validations on. I have to check if certain fields are null and then write the line containing the null field into a new file and then delete the line from the current file.
Can someone tell me how i could go... (2 Replies)
Discussion started by: goddevil
2 Replies
5. Shell Programming and Scripting
I have a reference file that needs to remain static and another file that may or may not have duplicate rows that match the reference file. I need help with a command that will delete any duplicate rows from the second file while leaving reference file intact
For example reference file would... (4 Replies)
Discussion started by: bjdamon
4 Replies
6. Shell Programming and Scripting
How do i use SED command to replace the last existance of ',' with a blank value OR CUT can also do??
Eg --> aaa,aaad,fsdfde,
I want to replace it with
aaa,aaad,fsdfde
Thanks in Advance (7 Replies)
Discussion started by: theeights
7 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I need a script where I have delete all the files of type abc*.* from the directory /lmn/opq (passed as parameter to script)
But I need to check if there is file of type abc*.* existing in the directory or not before I use the
rm abc*.*
command.
Thanks (1 Reply)
Discussion started by: dsrookie
1 Replies
8. UNIX for Dummies Questions & Answers
Hi and apologies but I'm normally a windows and network admin but atm I'm looking after a unix system while the admin is on holiday. I was assured everything would be fine but he's only been gone for 2 days and already webmail has stopped working!
It suggests that there is no space left:
... (2 Replies)
Discussion started by: shirtee
2 Replies
9. Shell Programming and Scripting
Hi,
Just consider there are around 10 lines in a file. Now is it possible to delete the first 2 lines in the file without opening the file. No matter whatever the content of the file is, I just wanna delete the first 2 lines without opening the file. Is that possible? If so, please help me out.... (3 Replies)
Discussion started by: toms
3 Replies
10. Shell Programming and Scripting
Hi All,
I want to delete the contents of few files which are really huge in size.
How the same can be done by using sed. Is there any other alternative to sed.
Thanks in advance (10 Replies)
Discussion started by: sumesh.abraham
10 Replies
TclXSLT(n) TclXSLT(n)
__________________________________________________________________________________________________________________________________________________
NAME
::xslt::compile -
SYNOPSIS
package require xslt
xslt2.5
::xslt
::xslt::compile doc
ssheet method ? option value ... ? ? args ... ?
::xslt::extensionadd nsuri tcl-namespace
_________________________________________________________________
DESCRIPTION
TclXSLT is a wrapper for the that allows an application to perform XSL transformations (XSLT). The package also provides a binding to the
XSLT extension mechanism so that XSLT extension may be implemented using Tcl scripts.
Transformation only works with documents created by TclDOM/libxml2.
The TclXSLT package makes extensive use of Tcl objects. Compiled XSL stylesheets are stored as the internal representation of a Tcl
object. Source and result documents are accessed via TclDOM's C interface as Tcl objects. This allows the application to cache parsed XML
documents and compiled XSL stylesheets for better runtime performance.
PACKAGES AND NAMESPACES
The TclXSLT package defines the package and also a Tcl namespace using that name.
COMMANDS
::xslt::compile
The ::xslt::compile command pre-compiles a stylesheet document. It returns a compiled stylesheet object and also defines a Tcl command to
access the stylesheet. This Tcl command may be used to transform XML documents.
NB. It is advisable to use the -baseuri option when parsing the source and stylesheet documents to allow external resources to be
resolved.
Stylesheet Command
The stylesheet command created by ::xslt::compile command accesses a compiled stylesheet.
Following is an example of how to use the stylesheet transform method.
Command Methods
The following command methods may be used:
cget option
Returns the value of an option. See below for the list of valid options.
configure optionvalue
Sets the value of an option. Available options are as follows:
transform source ? name value?
Performs an XSL transformation on the given source document. Stylesheet parameters may be specified as name-value pairs.
The return result is the DOM token for the result document.
Stylesheet Parameters
Any number of name-value pairs may be specified as arguments to the stylesheet transform method. These are passed as values for
parameters in the stylesheet. interprets the values as XPath expressions, where the context node is the root node for the source
document. To pass a value as a string it must be XPath-quoted, for example
set library "Gnome libxslt"
$ssheet transform $source_doc library '$library' author "'Daniel Veillard'" node {/*/Element[3]}
::xslt::extension
The ::xslt::extension command is used to manage extensions of the library. The add is used to register an extension. The remove is used
to unregister an extension. See for more detail.
EXTENSIONS
The TclXSLT package allows an application to bind Tcl scripts to the extension mechanism of . This means that Tcl scripts may provide the
implementation of an XSLT extension element or function. The binding is achieved to associating a Tcl namespace with an XML namespace.
Implementing An Extension
The Tcl application uses the ::xslt::extension add command to register an extension. An XML Namespace for the extension is specified as an
argument, along with a Tcl namespace that will provide implementations of extension elements and functions. For example,
Everytime the ::xslt::transform command is executed, a newly-created XSLT engine is initialized. For each registered extension, every pro-
cedure in the associated Tcl namespace is defined in the XSLT engine as either an extension element or an extension function. The proce-
dure is defined as an extension function if it has a variable argument list, otherwise it is defined as an extension element. The proce-
dure name is used as the local part of the extension name. For example,
"myfunc" is defined as an extension function and "myelement" is defined as an extension element.
Extension Functions
The arguments to an extension function are converted to a string value and then passed as parameters to the Tcl procedure.
The return result of the Tcl procedure becomes the return value of the extension function. The type of the result is preserved
where possible, otherwise it is converted to a string value.
Extension Elements
Extension elements have not been implemented in TclXSLT v1.1.
Using An Extension
To invoke an extension in an XSL stylesheet, use the normal XSLT extension mechanism. The XML Namespace matches the extension to the reg-
istered Tcl namespace (NB. the stylesheet author is free to choose any prefix for the extension namespace). For example,
This stylesheet would result in the following Tcl script being evaluated:
Tcl Built-In Commands Tcl TclXSLT(n)