Applications that read XML files?

M

mlt

Are there any applications that reads an XML file and let the user specify
(using eg. XPath) how the output should be generated and writes this to eg.
a text file?
 
R

Richard Tobin

Are there any applications that reads an XML file and let the user specify
(using eg. XPath) how the output should be generated and writes this to eg.
a text file?

LT-XML 2 (http://www.ltg.ed.ac.uk/software/ltxml2) includes lxprintf
which can be used for simple tasks of this kind. Here's an example
from the manual page:

<products>
<product price="3">Chicken</product>
<product price="11.50">Lobster</product>
<product price=".20">Apple</product>
<product price="1.09">Milk (2 litres)</product>
</products>

lxprintf -e product "%-20s $%5.2f\n" . @price <prices.xml

Print a list of products and their prices. The product name will
be padded to appear at the left of a 20-character field, and the
price will be padded to appear at the right of a 5-character
field. The output is:

Chicken $ 3.00
Lobster $11.50
Apple $ 0.20
Milk (2 litres) $ 1.09

-- Richard
 
M

mlt

Forgot to mention that I use Windows Vista.


Richard Tobin said:
LT-XML 2 (http://www.ltg.ed.ac.uk/software/ltxml2) includes lxprintf
which can be used for simple tasks of this kind. Here's an example
from the manual page:

<products>
<product price="3">Chicken</product>
<product price="11.50">Lobster</product>
<product price=".20">Apple</product>
<product price="1.09">Milk (2 litres)</product>
</products>

lxprintf -e product "%-20s $%5.2f\n" . @price <prices.xml

Print a list of products and their prices. The product name
will
be padded to appear at the left of a 20-character field, and
the
price will be padded to appear at the right of a
5-character
field. The output is:

Chicken $ 3.00
Lobster $11.50
Apple $ 0.20
Milk (2 litres) $ 1.09

-- Richard
 
S

Stefan Ram

mlt said:
Are there any applications that reads an XML file and let the user specify
(using eg. XPath) how the output should be generated and writes this to eg.
a text file?

Yes, they are called »implementations of programming languages«.

For example, there is the JDK, available at

http://java.sun.com/javase/downloads/index.jsp

. It is an implementation of Java SE:

http://java.sun.com/docs/books/tutorial/
http://java.sun.com/docs/books/jls/
http://download.java.net/jdk7/docs/api
 
R

Richard Tobin

Just in case you didn't know: XSLT can generate plain text files as
well as XML output.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,140
Latest member
SweetcalmCBDreview
Top