Saturday, February 9, 2013

How to execute xquery files ? (A simple approach)

Firstly,install Saxon X Query processor from Ubuntu software center or synaptic package manager.
you need to install two separate packages
  1. Saxon XSLT Processor (libsaxon-java)
  2. Saxon-B XSLT Processor (libsaxonb-java)
  • After installing both the packages,open terminal(shortcut-ctrl+alt+t) 
  • Change your directory that contains all the xml and xquery(.xqy) files.
  •  To run the xquery files,just run the below command with your sample.xqy(xquery file) in the terminal.
      $saxonb-xquery sample.xqy


thank you for reading
cheers !!!
sGk


Friday, February 8, 2013

How to validate xml file with xml schema ?


You can validate your xml file with xml schema in many ways,but in Linux system,one simple way is using xmllint .
If you don't have xmllint package,just install it from terminal

$sudo apt-get install xmllint

Now to validate a xml file called test.xml with the corresponding xml schema file test.xsd,just type in terminal as given below

$xmllint --noout --schema test.xsd test.xml

output
test.xml validates





thank you for reading
cheers !!!
sGk

Tuesday, February 5, 2013

How to record your session in linux ?

You can record your session in Linux using "script" command.
This records the login session in a file.It is useful to store in a file all keystrokes as well as other output and error messages.

$script
script started, file is typescript
$
.
.
.
Finally , you can terminate the session by entering "exit"

$exit
script done, file is typescript
$

Now, you can view this file using cat command
$cat typescript

Always, when you start your session using script,it actually overwrites the previous session information.So, if you want to append to the existing file

$script -a


thank you for reading !!!
cheers !
sGk