473,386 Members | 1,621 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Using xmllint and xpath without --shell

Using

xmllint --shell ...

there is a great xpath parser. For instance you can do "//body" to extract
only the <BODY of an html document.

But how can you do this with just the commande line?

I need a shell one liner to grab the contents of a <body> XXXX </body>
tag...Preferably without using perl...

Neil
Jul 20 '05 #1
1 4035
Neil McNaughton wrote:
Using

xmllint --shell ...

there is a great xpath parser. For instance you can do "//body" to extract only the <BODY of an html document.

But how can you do this with just the commande line?

I need a shell one liner to grab the contents of a <body> XXXX </body> tag...Preferably without using perl...

Neil


You can use xmlstarlet (http://xmlstar.sourceforge.net/)
xml sel -t -v "//body" your.xml

--MG

Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: 0wl | last post by:
Hi, I am trying to get the value of child from xmlstr = """<p:root xmlns:p="http://tempuri.org/string"><p:child DataType="String">Hellpppp</p:child></p:root>""" using...
12
by: km | last post by:
hi all, can any linux command be invoked/ executed without using shell (bash) ? what abt security concerns ? regards, KM
2
by: Anna | last post by:
Hi all. I am using Jaxen to evaluate XPath expressions in Java. I encountered problems when comparing results returned by jaxen with results returned by other XPath implementation - I was using...
0
by: anthony.raj | last post by:
Hi, I have an XML Datasource in the following format - <?xml version="1.0" encoding="ISO-8859-1" standalone="no" ?> <table> <event > <field name="user" value="anthony"/> <field name="date"...
6
by: bill | last post by:
I have a VB .net 2.0 site that needs to run a dos app upon a button click. I found Shell too unreliable using parameters and so used system.diagnostic.process. simple troubleshooting...
3
by: George Sakkis | last post by:
I'm trying to figure out why Popen captures the stderr of a specific command when it runs through the shell but not without it. IOW: cmd = if 1: # this captures both stdout and stderr as...
1
by: brahatha | last post by:
I am trying to come up with a Java code where I can read a xml file and extract particular element/attribute. This is the structure of xml I have <RootElement> <colAttempt> <Attempt1 a="1"...
5
by: rcronk | last post by:
I'm new to C#/.NET. I am writing some C#/.NET (2.0) classes that will allow someone to get and set values in an XML file using an XPath to point to the location of that data. It's more complicated...
5
by: progvar | last post by:
Hi, i want to know how to unzip a zip file and extract the files to a particular location please help me thanks in advance varinder
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.