Sponsored Content
Top Forums Shell Programming and Scripting XML: parsing of the Google contacts XML file Post 302748107 by fpmurphy on Monday 24th of December 2012 09:21:46 AM
Old 12-24-2012
Quote:
Could that be that the file is corrupt? A xmllint --debug doesn't return anything abnormal though.
No, your sample file is not corrupt. It is valid XML. It just has no DTD - which is fine.

It has multiple namespaces in it, that is why xmllint does not work.

Last edited by fpmurphy; 12-24-2012 at 10:47 AM..
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Parsing xml file using Sed

Hi All, I have this(.xml) file as: <!-- define your instance here --> <instance name='ins_C2Londondev' user='' group='' fullname='B2%20-%20London%20(dev)' > <property> </property> </instance> I want output as: <!-- define your instance here --> <instance... (3 Replies)
Discussion started by: kapilkinha
3 Replies

2. Shell Programming and Scripting

XML file parsing using script

Hi I need some help with XML file parsing. I have an XML file with the below tag, I need a script to identify the value of srvcName which is this case is "AAA srvc name". I need to put contents of this value which is AAA srvc and name into different variables using an array and then reformat it... (6 Replies)
Discussion started by: zmfcat1
6 Replies

3. UNIX for Dummies Questions & Answers

Help parsing a XML file ....

Well I have read several threads on the subject ... but being a newbie like me makes it hard to understand ... What I need is the following: Input data: ------- snip --------- <FavouriteLocations> <FavouriteLocations class="FavouriteList"><Item... (6 Replies)
Discussion started by: misak
6 Replies

4. Shell Programming and Scripting

Parsing xml file

hi guys, great help to the original question, can i expand please? i have large files filled with blocks like this <Placemark> network type: hot line1 line2 line3 <styleUrl>red.png</styleUrl> </Placemark> <Placemark> network type: cold line1 line2 line3... (3 Replies)
Discussion started by: garvald
3 Replies

5. Shell Programming and Scripting

Help in parsing xml file (sed/nawk)

I have a large xml file as shown below: <input> <blah> <blah> <atr="blah blah value = ""> <blah> <blah> </input> ..2nd chunk... ..3rd chunk... ...4th chunk... All lines between <input> and </input> is one 'order' and this 'order' is repeated... (14 Replies)
Discussion started by: shekhar2010us
14 Replies

6. Shell Programming and Scripting

parsing xml file

Hello! We need to parse weblogic config.xml file and display rows in format: machine:listen-port:name:application_name In our enviroment the output should be (one line for every instance): Crm-Test-Web:8001:PIA:peoplesoft Crm-Test-Web:8011:PIA:peoplesoft... (9 Replies)
Discussion started by: annar
9 Replies

7. Shell Programming and Scripting

Parsing an XML file

Hello, I have the following xml file as an input. <?xml version="1.0" encoding="UTF-8"?> <RECORDS PS3_VERSION="1104_01"><RECORD> <POI_ID>931</POI_ID> <SUPPLIER_ID>2</SUPPLIER_ID> <POI_PVID>997920846</POI_PVID> <DB_ID>1366650925</DB_ID> <REGION>H1</REGION> <POI_NAME NAME_TYPE="Official"... (4 Replies)
Discussion started by: ramky79
4 Replies

8. UNIX for Dummies Questions & Answers

Parsing XML file

I want to parse xml file sample file....... <name locale="en">my_name<>/name><lastChanged>somedate</lastChanged><some more code here> <name locale="en">tablename1<>/name><lastChanged>somedate</lastChanged> <definition><dbquery><sources><sql type="cognos">select * from... (10 Replies)
Discussion started by: ms2001
10 Replies

9. Shell Programming and Scripting

Help with parsing xml file

Hi, Need help with parsing xml data in unix and place it in a csv file. My xml file looks like this: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <iwgroups> <nextid value="128"> </nextid> <iwgroup name="RXapproval" id="124" display-name="RXapproval"... (11 Replies)
Discussion started by: ajayakunuri
11 Replies
dctrl2xml(1)															      dctrl2xml(1)

NAME
dctrl2xml - Debian control data to XML converter SYNOPSIS
dctrl2xml [-x | -j] [-f FILE] DESCRIPTION
dctrl2xml is a tool that converts Debian control data into an XML representation. It can be used to convert data which is normally found in debian/control, .changes, .dsc, Packages, Sources, and similar files to XML. For most fields dctrl2xml just uses the field name as element name and the field data as element content. For other fields, such as package interrelationship fields (Depends, Build-Depends, etc.) or the Files field in .changes or Sources files, dctrl2xml additionally parses their field data to represent it in a more fine-structured form. OPTIONS
For a full summary of options, run dctrl2xml --help. --version Show dctrl2xml's version number. -h, --help Show help about options. -f FILE, --file=FILE Read Debian control data from file FILE instead of standard input. FILE can be either a plain text file or a gzip, bzip2 or ZIP file. -x, --xml Output Debian control data as XML (default). -j, --json Output Debian control data as JSON. EXAMPLES
dctrl2xml -f /var/lib/dpkg/available Convert the whole dpkg(1) available file to XML and print it to standard output. This is a typical stress test for dctrl2xml. apt-cache show hello build-essential | dctrl2xml Convert the package records of the hello and build-essential packages to XML and print it to standard output. This is an example of how dctrl2xml can be used in pipes where it reads the control data from standard input. apt-cache showsrc hello | dctrl2xml | xmllint --format - This is similar to the above example, except that the xmllint(1) tool (which is in the libxml2-utils Debian package) is used to re- format and reindent dctrl2xml's output to make it more human readable and that the source package records of the hello package are used. apt-cache showsrc hello | dctrl2xml -j In this example hello's source package record is printed as JSON instead of XML. SEE ALSO
deb-control(5) AUTHOR
Written by Frank S. Thomas <fst@debian.org>. 20 August 2010 dctrl2xml(1)
All times are GMT -4. The time now is 07:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy